From 642f1b16c9d339ef33950488418cf47c43832b70 Mon Sep 17 00:00:00 2001 From: the xhr Date: Thu, 9 Jan 2025 21:29:37 +0000 Subject: [PATCH] Mechanical diff to convert dice results from ints to enum ints --- character.c | 6 +-- delve.c | 24 +++++------ fight.c | 48 ++++++++++----------- journey.c | 12 +++--- rolls.c | 108 +++++++++++++++++++++++------------------------ sundered_isles.c | 38 ++++++++--------- vows.c | 6 +-- 7 files changed, 121 insertions(+), 121 deletions(-) diff --git a/character.c b/character.c index f5e3632..abfbcb0 100644 --- a/character.c +++ b/character.c @@ -248,14 +248,14 @@ cmd_learn_from_your_failures(__attribute__((unused)) char *unused) toggle_output(); ret = progress_roll(dval); toggle_output(); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("exp", INCREASE, 3); printf("You commit to make a dramatic change. Choose one option -> "\ "Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { change_char_value("exp", INCREASE, 2); printf("You learn from your mistakes\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { change_char_value("exp", INCREASE, 1); printf("Envision on how you set off an ill-fated path\n"); } diff --git a/delve.c b/delve.c index 3426967..9d38da9 100644 --- a/delve.c +++ b/delve.c @@ -99,11 +99,11 @@ cmd_delve_the_depths(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You mark progress, delve deeper and find an opportunity:\n"); mark_delve_progress(INCREASE); read_oracle_from_json(ORACLE_DELVE_OPPORTUNITY, 0); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("Rolling on the delve table with %s\n", stat); if (usedstat == 1) read_oracle_from_json(ORACLE_DELVE_THE_DEPTHS_WITS, 0); @@ -111,7 +111,7 @@ cmd_delve_the_depths(char *cmd) read_oracle_from_json(ORACLE_DELVE_THE_DEPTHS_SHADOW, 0); else if (usedstat == 3) read_oracle_from_json(ORACLE_DELVE_THE_DEPTHS_EDGE, 0); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You reveal a danger:\n"); read_oracle_from_json(ORACLE_DELVE_DANGER, 0); } @@ -142,14 +142,14 @@ cmd_check_your_gear(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You have the needed gear\n"); change_char_value("momentum", INCREASE, 1); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You have the needed gear, but suffer -1 supply\n"); change_char_value("momentum", INCREASE, 1); change_char_value("supply", DECREASE, 1); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You don't have the needed gear and the situation grows more "\ "perilous -> Rulebook\n"); } @@ -192,19 +192,19 @@ cmd_escape_the_depths(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You make your way safely out\n"); change_char_value("momentum", INCREASE, 1); curchar->delve_active = 0; curchar->delve->progress = 0; delete_delve(curchar->id); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You make your way out, but this place exacts its price.\n"); printf("Choose one from the Rulebook\n"); curchar->delve_active = 0; curchar->delve->progress = 0; delete_delve(curchar->id); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("A dire threat or imposing obstacle stands in your way\n"); printf("Reveal a danger and if you success, you make your way out!\n"); read_oracle_from_json(ORACLE_DELVE_DANGER, 0); @@ -231,19 +231,19 @@ cmd_locate_your_objective(char *cmd) dval[1] = get_int_from_cmd(cmd); ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You locate your objective and the situation favors you -> "\ "Rulebook\n"); curchar->delve_active = 0; curchar->delve->progress = 0; delete_delve(curchar->id); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You locate your objective but face an unforeseen complication "\ "-> Rulebook\n"); curchar->delve_active = 0; curchar->delve->progress = 0; delete_delve(curchar->id); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { locate_your_objective_failed(); } diff --git a/fight.c b/fight.c index f8eb0ae..f607efc 100644 --- a/fight.c +++ b/fight.c @@ -58,13 +58,13 @@ cmd_enter_the_fray(char *cmd) curchar->fight_active = 1; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 2); set_initiative(1); printf("You have initiative\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You may choose one boost -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); update_prompt(); @@ -92,11 +92,11 @@ cmd_end_the_fight(__attribute__((unused)) char *unused) dval[0] = curchar->fight->progress; ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("The foe is no longer in the fight -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("The foe is no longer in the fight, but you must chose one option -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You lost the fight. Pay the price -> Rulebook\n"); } curchar->fight_active = 0; @@ -124,27 +124,27 @@ cmd_take_decisive_action(__attribute__((unused)) char *unused) ret = progress_roll(dval); if (curchar->fight->initiative) { /* If in control, results count as normal ... */ - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { tda_strong: change_char_value("momentum", INCREASE, 1); printf("You prevail. If any objectives remain and the fight "\ "continues, you're in control\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { tda_weak: printf("You achieve your objective, but not without a cost "\ "-> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { tda_miss: printf("Your are defeated or your objective is lost. Pay the price\n"); } } else { /* ... otherwise, it gets harder */ - if (ret == 18) /* Strong hit with matches is a strong hit */ + if (ret == STRONG_MATCH) /* Strong hit with matches is a strong hit */ goto tda_strong; - else if (ret == 8 || ret == 18) { + else if (ret == STRONG || ret == STRONG_MATCH) { printf("You are not in control -> weak hit\n"); goto tda_weak; /* Strong hit w/o match -> weak hit */ - } else if (ret == 4 || ret == 2) { + } else if (ret == WEAK || ret == MISS) { printf("You are not in control -> miss\n"); goto tda_miss; /* Everything else is a miss */ } @@ -204,11 +204,11 @@ cmd_endure_harm(char *cmd) } ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You shake it off or embrace the pain -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You press on\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { change_char_value("momentum", DECREASE, 1); if (curchar->health == 0) printf("Mark either maimed or wounded or roll on the oracle table -> Rulebook\n"); @@ -246,7 +246,7 @@ cmd_strike(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You inflict +1 harm and retain initiative\n"); set_initiative(1); @@ -257,7 +257,7 @@ cmd_strike(char *cmd) mark_fight_progress(INCREASE); mark_fight_progress(INCREASE); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You inflict harm and lose initiative\n"); set_initiative(0); @@ -267,7 +267,7 @@ cmd_strike(char *cmd) } mark_fight_progress(INCREASE); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Pay the price -> Rulebook\n"); set_initiative(0); update_prompt(); @@ -305,7 +305,7 @@ cmd_clash(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You inflict harm, regain initiative and can choose one option -> Rulebook\n"); set_initiative(1); @@ -315,7 +315,7 @@ cmd_clash(char *cmd) } mark_fight_progress(INCREASE); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You inflict harm and lose initiative. Pay the price -> Rulebook\n"); set_initiative(0); @@ -325,7 +325,7 @@ cmd_clash(char *cmd) } mark_fight_progress(INCREASE); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Pay the price -> Rulebook\n"); set_initiative(0); update_prompt(); @@ -367,12 +367,12 @@ cmd_battle(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 2); printf("You achieve your objective unconditionally\n"); - } else if (ret == 4 || ret == 14) /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) /* weak hit */ printf("You achieve your objective, but not without a cost -> Rulebook\n"); - else if (ret == 2 || ret == 12) /* miss */ + else if (ret == MISS || ret == MISS_MATCH) /* miss */ printf("Pay the price -> Rulebook\n"); } diff --git a/journey.c b/journey.c index 034df23..342ff1e 100644 --- a/journey.c +++ b/journey.c @@ -56,14 +56,14 @@ cmd_undertake_a_journey(char *cmd) } ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You reach a waypoint and can choose one option -> Rulebook\n"); mark_journey_progress(INCREASE); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You reach a waypoint, but suffer -1 supply\n"); change_char_value("supply", DECREASE, 1); mark_journey_progress(INCREASE); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); update_prompt(); @@ -87,19 +87,19 @@ cmd_reach_your_destination(char *cmd) dval[1] = get_int_from_cmd(cmd); ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You reach your destination and the situation favors you -> "\ "Rulebook\n"); curchar->journey_active = 0; curchar->j->progress = 0; delete_journey(curchar->id); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You reach your destination but face an unforeseen complication "\ "-> Rulebook\n"); curchar->journey_active = 0; curchar->j->progress = 0; delete_journey(curchar->id); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { reach_your_destination_failed(); } diff --git a/rolls.c b/rolls.c index a46aea5..00035b7 100644 --- a/rolls.c +++ b/rolls.c @@ -46,13 +46,13 @@ cmd_gather_information(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ change_char_value("momentum", INCREASE, 2); printf("You discover something helpful and specific\n"); - } else if (ret == 4 || ret == 14) { /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) { /* weak hit */ change_char_value("momentum", INCREASE, 1); printf("The information complicates your quest or introduces a new danger\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -69,11 +69,11 @@ cmd_sojourn(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("You may choose two options -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) { /* weak hit */ printf("You may choose one option -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -90,12 +90,12 @@ cmd_draw_the_circle(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 1); printf("You may choose even more boasts -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You may choose one boast -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -114,13 +114,13 @@ cmd_swear_an_iron_vow(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 2); printf("You are emboldened and know what you must do next\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { change_char_value("momentum", INCREASE, 1); printf("You are determined but begin your quest with questions\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("You face a significant obstacle -> Rulebook\n"); } @@ -137,12 +137,12 @@ cmd_forge_a_bond(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You forge a bond and choose one option -> Rulebook\n"); curchar->bonds += 0.25; - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("They ask something from you first -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("You are refused. Pay the price -> Rulebook\n"); } @@ -194,11 +194,11 @@ cmd_test_your_bond(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("This test has strengthened your bond. Choose one -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("Your bond is fragile -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Your bond is cleared. Pay the price -> Rulebook\n"); curchar->bonds -= 0.25; } @@ -243,11 +243,11 @@ cmd_endure_stress(char *cmd) } ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You shake it off or embrace the darkness -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("You press on\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { change_char_value("momentum", DECREASE, 1); if (curchar->health == 0) printf("Mark either shaken or corrupted or roll on the oracle table -> Rulebook\n"); @@ -267,11 +267,11 @@ cmd_face_death(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("Death rejects you.\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("Your must choose one option -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You are dead\n"); curchar->dead = 1; } @@ -308,13 +308,13 @@ cmd_heal(char *who) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ change_char_value("health", INCREASE, 2); printf("Your care is helpful\n"); - } else if (ret == 4 || ret == 14) { /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) { /* weak hit */ change_char_value("health", INCREASE, 1); printf("You healing is successful, but you have to suffer -1 supply or momentum\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -380,11 +380,11 @@ cmd_resupply(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ change_char_value("supply", INCREASE, 2); - } else if (ret == 4 || ret == 14) { /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) { /* weak hit */ printf("Take up to +2 supply, but suffer -1 momentum for each\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -402,11 +402,11 @@ cmd_face_desolation(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("You resist and press on\n"); - } else if (ret == 4 || ret == 14) { /* weak hit */ + } else if (ret == WEAK || ret == WEAK_MATCH) { /* weak hit */ printf("Choose one option -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("You succumb to despair and horror and are lost -> Rulebook\n"); } @@ -424,11 +424,11 @@ cmd_make_camp(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) + if (ret == STRONG || ret == STRONG_MATCH) printf("Choose two options-> Rulebook\n"); - else if (ret == 4 || ret == 14) + else if (ret == WEAK || ret == WEAK_MATCH) printf("Choose one option-> Rulebook\n"); - else if (ret == 2 || ret == 12) + else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -459,11 +459,11 @@ cmd_face_danger(char *stat) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) /* strong hit */ change_char_value("momentum", INCREASE, 1); - else if (ret == 4 || ret == 14) /* weak hit */ + else if (ret == WEAK || ret == WEAK_MATCH) /* weak hit */ printf("Face a troublesome cost -> Rulebook\n"); - else if (ret == 2 || ret == 12) + else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -494,13 +494,13 @@ cmd_compel(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 1); printf("You might get +1 for your next move -> Rulebook\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { change_char_value("momentum", INCREASE, 1); printf("You might be asked for something in return -> Rulebook\n"); - } else if (ret == 2 || ret == 12) + } else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -534,11 +534,11 @@ cmd_secure_an_advantage(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) + if (ret == STRONG || ret == STRONG_MATCH) printf("Gain an advantage -> Rulebook\n"); - else if (ret == 4 || ret == 14) + else if (ret == WEAK || ret == WEAK_MATCH) change_char_value("momentum", INCREASE, 1); - else if (ret == 2 || ret == 12) + else if (ret == MISS || ret == MISS_MATCH) printf("Pay the price -> Rulebook\n"); } @@ -554,12 +554,12 @@ cmd_write_your_epilogue(__attribute__((unused)) char *unused) dval[0] = curchar->bonds; ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("Things come to pass as you hoped\n"); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("Your life takes an unexpected turn, but not necessary for the worse"\ " -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Your fears are realized\n"); } } @@ -745,17 +745,17 @@ action_roll(int args[2]) if (b <= c1 && b <= c2) { pm(RED, "miss\n"); - ret = 2; + ret = MISS; /* Increase the failure track by one tick on every miss */ modify_double("failure", &curchar->failure_track, 10.0, 0.0, 0.25, INCREASE); } else if (b <= c1 || b <= c2) { pm(YELLOW, "weak hit\n"); - ret = 4; + ret = WEAK; } else if (b > c1 && b > c2) { pm(GREEN, "strong hit\n"); if (curchar != NULL) curchar->strong_hit = 1; - ret = 8; + ret = STRONG; } /* In case of a match, 10 are added */ @@ -808,15 +808,15 @@ progress_roll(double args[2]) if (pr_score <= c1 && pr_score <= c2) { pm(RED, "miss\n"); - ret = 2; + ret = MISS; /* Increase the failure track by two ticks on every miss */ modify_double("failure", &curchar->failure_track, 10.0, 0.0, 0.5, INCREASE); } else if (pr_score <= c1 || pr_score <= c2) { pm(YELLOW, "weak hit\n"); - ret = 4; + ret = WEAK; } else if (pr_score > c1 && pr_score > c2) { pm(GREEN, "strong hit\n"); - ret = 8; + ret = STRONG; } return ret + match; diff --git a/sundered_isles.c b/sundered_isles.c index 8db842c..083c598 100644 --- a/sundered_isles.c +++ b/sundered_isles.c @@ -65,7 +65,7 @@ cmd_set_a_course(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ change_char_value("momentum", INCREASE, 1); printf("You reach your destination and the situation favours you.\n"); } else if (ret == 4 || ret == 14) { /* weak hit */ @@ -90,18 +90,18 @@ cmd_explore_a_waypoint(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 18) { /* strong hit with a match */ + if (ret == STRONG_MATCH) { /* strong hit with a match */ printf("Strong hit with a match. You make a discovery\n"); - } else if (ret == 12) { /* miss with a match */ + } else if (ret == MISS_MATCH) { /* miss with a match */ printf("Miss with a match. You may confront chaos\n"); - } else if (ret == 8 || ret == 18) { /* strong hit */ + } else if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("Choose one:\n"); printf(" - Find an opportunity, envision it and take 2 momentum\n"); printf(" - Mark progress on your expedition\n"); } else if (ret == 4 || ret == 14) { /* weak hit */ change_char_value("momentum", INCREASE, 1); printf("You uncover something interesting, but it is bound up in a peril\n"); - } else if (ret == 2) { /* miss */ + } else if (ret == MISS) { /* miss */ printf("You encounter a hardship or threat. Pay the price -> Rulebook\n"); } } @@ -119,13 +119,13 @@ cmd_hearten(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("You find companionship or comfort -> Rulebook\n"); } else if (ret == 4 || ret == 14) { /* weak hit */ change_char_value("momentum", DECREASE, 1); printf("You find companionship or comfort, but this indulgence is "\ "fleeting\n"); - } else if (ret == 2 || ret == 12) { /* miss */ + } else if (ret == MISS || ret == MISS_MATCH) { /* miss */ printf("You take no comfort and the situation worsens. Pay the "\ "price -> Rulebook\n"); } @@ -144,12 +144,12 @@ cmd_make_a_connection(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("You make a connection. Follow the Rulebook for role and rank.\n"); } else if (ret == 4 || ret == 14) { /* weak hit */ printf("You make a connection. Follow the Rulebook for role and rank.\n"); printf("However, this connection comes with a complication or cost.\n"); - } else if (ret == 2 || ret == 12) { /* miss */ + } else if (ret == MISS || ret == MISS_MATCH) { /* miss */ printf("You don’t make a connection and the situation worsens. Pay the "\ "price -> Rulebook\n"); } @@ -168,12 +168,12 @@ cmd_test_your_relationship(char *cmd) ival[1] = get_int_from_cmd(cmd); ret = action_roll(ival); - if (ret == 8 || ret == 18) { /* strong hit */ + if (ret == STRONG || ret == STRONG_MATCH) { /* strong hit */ printf("You develop your relationship -> Rulebook\n"); } else if (ret == 4 || ret == 14) { /* weak hit */ printf("You develop your relationship, but also envision a demand " \ "or complication as a fallout of this test -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { /* miss */ + } else if (ret == MISS || ret == MISS_MATCH) { /* miss */ printf("if you have no interest in maintaining this relationship, " \ "choose one -> Rulebook\n"); } @@ -263,11 +263,11 @@ cmd_gain_ground(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You stay in control. Choose two -> Rulebook\n"); } else if (ret == 4 || ret == 14) { printf("You stay in control. Choose one -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { set_initiative(0); printf("You are in a bad spot, your foe gains the upper hand. Pay "\ "the price.\n"); @@ -316,14 +316,14 @@ cmd_react_under_fire(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { change_char_value("momentum", INCREASE, 1); set_initiative(1); printf("You success and are in control.\n"); } else if (ret == 4 || ret == 14) { printf("You avoid the worst of the danger or overcome the obstacle, but\n"); printf("not without a cost. Make a suffer move and stay in a bad spot.\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You stay in a bad spot. Pay the price.\n"); } @@ -370,7 +370,7 @@ cmd_undertake_an_expedition(char *cmd) goto info; ret = action_roll(ival); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You reach a waypoint and mark progress.\n"); mark_expedition_progress(INCREASE); } else if (ret == 4 || ret == 14) { @@ -378,7 +378,7 @@ cmd_undertake_an_expedition(char *cmd) printf(" - Suffer costs en route: Make a suffer move (-2) or two suffer moves (-1).\n"); printf(" - Face peril on a waypoint.\n"); mark_expedition_progress(INCREASE); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("You are waylaid by a crisis. Pay the price.\n"); } @@ -403,12 +403,12 @@ cmd_finish_an_expedition(char *cmd) dval[1] = get_int_from_cmd(cmd); ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("You reach your destination or complete your survey -> Rulebook\n"); } else if (ret == 4 || ret == 14) { printf("You reach your destination or complete your survey "\ "but face an unforeseen complication -> Rulebook\n"); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Your destination is lost to you, or you come to understand "\ "the true nature or cost of the expedition -> Rulebook\n"); } diff --git a/vows.c b/vows.c index 28968f4..889a781 100644 --- a/vows.c +++ b/vows.c @@ -251,15 +251,15 @@ cmd_fulfill_your_vow(char *cmd) dval[0] = curchar->vow->progress; dval[1] = get_int_from_cmd(cmd); ret = progress_roll(dval); - if (ret == 8 || ret == 18) { + if (ret == STRONG || ret == STRONG_MATCH) { printf("Your quest is complete\n"); change_char_value("exp", INCREASE, curchar->vow->difficulty); change_char_value("legacy_quests", INCREASE, curchar->vow->difficulty); - } else if (ret == 4 || ret == 14) { + } else if (ret == WEAK || ret == WEAK_MATCH) { printf("There is more to be done or you realize the truth of your quest "\ "-> Rulebook\n"); change_char_value("exp", INCREASE, curchar->vow->difficulty-1); - } else if (ret == 2 || ret == 12) { + } else if (ret == MISS || ret == MISS_MATCH) { printf("Your quest is undone -> Rulebook\n"); }