Skip to content

Commit 469a086

Browse files
committed
cap otaku mpcp to 2x REAL int, plus some cleanup
1 parent 3cd6082 commit 469a086

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

src/cf_create.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void cfedit_parse(struct descriptor_data *d, const char *arg)
159159
if (option_n > GET_SKILL(CH, SKILL_COMPUTER)) {
160160
send_to_char(CH, "You can't create a complex form of a higher rating than your computer skill.\r\n"
161161
"Enter Rating: ");
162-
} else if (option_n > GET_OTAKU_MPCP(CH)) {
162+
} else if (option_n > get_otaku_mpcp(CH)) {
163163
send_to_char(CH, "You can't create a complex form of a higher rating than your living persona's MPCP rating.\r\n"
164164
"Enter Rating: ");
165165
} else if (option_n <= 0) {

src/otaku.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,20 @@ int get_otaku_rea(struct char_data *ch) {
154154
return rea_stat;
155155
}
156156

157+
int get_otaku_mpcp(struct char_data *ch) {
158+
int mpcp = (get_otaku_int(ch) + get_otaku_wil(ch) + get_otaku_cha(ch) + 2) / 3
159+
+ GET_ECHO(ch, ECHO_IMPROVED_MPCP);
160+
161+
// HOUSERULE: cap otaku MPCP to 2x REAL int
162+
#ifdef DIES_IRAE
163+
return MIN(GET_REAL_INT(ch) * 2, mpcp);
164+
#else
165+
// human/elf/dwarf otaku have 7 max real int, so cap 14
166+
// let troll/ork otaku reach the same mpcp cap
167+
return MIN(14, mpcp);
168+
#endif
169+
}
170+
157171
extern struct obj_data *make_new_finished_part(int part_type, int mpcp, int rating=0);
158172
struct obj_data *make_otaku_deck(struct char_data *ch) {
159173
if (!ch) {
@@ -169,7 +183,7 @@ struct obj_data *make_otaku_deck(struct char_data *ch) {
169183
struct obj_data *new_deck = read_object(OBJ_CUSTOM_CYBERDECK_SHELL, VIRTUAL, OBJ_LOAD_REASON_OTAKU_RESONANCE);
170184

171185
// Add parts.
172-
int mpcp = GET_OTAKU_MPCP(ch);
186+
int mpcp = get_otaku_mpcp(ch);
173187

174188
// Real values are assigned in update_otaku_deck()
175189
obj_to_obj(make_new_finished_part(PART_MPCP, mpcp, mpcp), new_deck);
@@ -264,9 +278,9 @@ void _update_living_persona(struct char_data *ch, struct obj_data *cyberdeck, in
264278
}
265279

266280
void update_otaku_deck(struct char_data *ch, struct obj_data *cyberdeck) {
267-
int mpcp = GET_OTAKU_MPCP(ch);
281+
int mpcp = get_otaku_mpcp(ch);
268282

269-
GET_CYBERDECK_MPCP(cyberdeck) = MIN(12, mpcp);
283+
GET_CYBERDECK_MPCP(cyberdeck) = mpcp;
270284
GET_CYBERDECK_HARDENING(cyberdeck) = (get_otaku_wil(ch) + 1) / 2 + GET_ECHO(ch, ECHO_IMPROVED_HARD);
271285
GET_CYBERDECK_HARDENING(cyberdeck) = MIN(get_otaku_wil(ch), GET_CYBERDECK_HARDENING(cyberdeck));
272286
GET_CYBERDECK_ACTIVE_MEMORY(cyberdeck) = 0; // Otaku do not have active memory.

src/otaku.hpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ struct otaku_echo {
77
bool nerps;
88
};
99

10-
int get_otaku_cha(struct char_data *ch);
11-
int get_otaku_wil(struct char_data *ch);
12-
int get_otaku_int(struct char_data *ch);
13-
int get_otaku_qui(struct char_data *ch);
14-
int get_otaku_rea(struct char_data *ch);
10+
int get_otaku_mpcp(struct char_data *ch);
1511

1612
void update_otaku_deck(struct char_data *ch, struct obj_data *cyberdeck);
1713

@@ -23,13 +19,4 @@ void update_otaku_deck(struct char_data *ch, struct obj_data *cyberdeck);
2319

2420
extern int complex_form_programs[COMPLEX_FORM_TYPES];
2521

26-
#define GET_OTAKU_MPCP(ch) \
27-
(({ \
28-
int mpcp = (get_otaku_int(ch) + get_otaku_wil(ch) + get_otaku_cha(ch) + 2) / 3; \
29-
if (GET_ECHO(ch, ECHO_IMPROVED_MPCP)) { \
30-
mpcp = MIN(get_otaku_int(ch) * 2, mpcp + GET_ECHO(ch, ECHO_IMPROVED_MPCP)); \
31-
} \
32-
mpcp; \
33-
}))
34-
3522
#endif

0 commit comments

Comments
 (0)