diff --git a/scripts_src/brokhill/hcmarcus.ssl b/scripts_src/brokhill/hcmarcus.ssl index 27ec47291..bf7f65718 100644 --- a/scripts_src/brokhill/hcmarcus.ssl +++ b/scripts_src/brokhill/hcmarcus.ssl @@ -396,7 +396,7 @@ procedure talk_p_proc begin gSay_End; end_dialogue; end - else if (self_rep < -10) then begin + else if (perceived_rep < -10) then begin start_gdialog(NAME,self_obj,4,HEAD_MARCUS,PartyMemberBackground); gSay_Start; call Node045; @@ -578,7 +578,7 @@ procedure Node001a begin if ( ( (global_var(GVAR_BH_MINE) == MINE_FIXED_CASH) or (global_var(GVAR_BH_MINE) == MINE_FIXED_FREE) or (global_var(GVAR_BH_MINE) == MINE_REWARDED) ) and ( (global_var(GVAR_BH_CONSPIRACY) == CONSPIRACY_BROKEN_DOUBLECROSS) or (global_var(GVAR_BH_CONSPIRACY) == CONSPIRACY_BROKEN_HERO) or (global_var(GVAR_BH_JAIL) == JAIL_DOUBLECROSS) ) and - self_rep_positive and + ( perceived_rep >= 0 ) and ( dude_has_free_slot_for_marcus ) ) then call Node030; else @@ -918,7 +918,7 @@ procedure Node031 begin else Reply(276); end - else if self_rep_negative then + else if perceived_rep_negative then Reply(277); else Reply(213); @@ -1272,7 +1272,7 @@ procedure Node1100 begin Reply(277); BOption(3100, Node999, 001); //added by killap BOption(3200, Node999, 001); //added by killap - end else if has_rep_childkiller or (self_rep < -100) then begin + end else if has_rep_childkiller or (perceived_rep < -100) then begin set_self_abandon_party; Reply(277); BOption(3100, Node999, 001); //added by killap diff --git a/scripts_src/den/dcaddict.ssl b/scripts_src/den/dcaddict.ssl index 3a0ec414e..feb06449b 100644 --- a/scripts_src/den/dcaddict.ssl +++ b/scripts_src/den/dcaddict.ssl @@ -276,7 +276,7 @@ procedure Node001 begin end procedure Node002 begin if (heavy_high) then begin - floater_rand(201 - self_rep_negative, 212 + self_rep_positive ); + floater_rand(201 - perceived_rep_negative, 212 + perceived_rep_positive); end else if (light_high) then begin floater_rand(215 - dude_is_male, 221); end else if (light_withdrawal) then begin diff --git a/scripts_src/den/dcrebecc.ssl b/scripts_src/den/dcrebecc.ssl index d4e5f9419..a37576b85 100644 --- a/scripts_src/den/dcrebecc.ssl +++ b/scripts_src/den/dcrebecc.ssl @@ -352,7 +352,7 @@ procedure Node007 begin prev_node := 7; end procedure Node008 begin - if self_rep_negative then begin + if perceived_rep_negative then begin Reply(350); end else if (becky_job(state_becky_job_none)) then begin Reply(351 + told_collect); diff --git a/scripts_src/den/dcslvgrt.ssl b/scripts_src/den/dcslvgrt.ssl index 4daab4a19..e1ca5df21 100644 --- a/scripts_src/den/dcslvgrt.ssl +++ b/scripts_src/den/dcslvgrt.ssl @@ -247,7 +247,7 @@ procedure Node002 begin BMessage(217); end else begin set_node_2; - Reply(215 + self_rep_negative); + Reply(215 + (cult_rep >= 0)); if (has_rep_slaver == false) then begin NOption(218, Node010, 004); NOption(221, Node010, -003); //added by killap diff --git a/scripts_src/den/dctubfri.ssl b/scripts_src/den/dctubfri.ssl index 1b1afea64..270f59a0e 100644 --- a/scripts_src/den/dctubfri.ssl +++ b/scripts_src/den/dctubfri.ssl @@ -224,9 +224,9 @@ procedure Node002 begin end end else if ((has_rep_slaver) and (random(0,1))) then begin floater_rand(232,235); - end else if (check_title_bad(-100) and random(0,1)) then begin + end else if (perceived_rep <= -100 and random(0,1)) then begin floater(220); - end else if (check_title(100) and random(0,1)) then begin + end else if (perceived_rep >= 100 and random(0,1)) then begin floater(221 + dude_is_female); end else begin floater_rand(223,231); diff --git a/scripts_src/gecko/gclenny.ssl b/scripts_src/gecko/gclenny.ssl index 054096943..e770c7248 100644 --- a/scripts_src/gecko/gclenny.ssl +++ b/scripts_src/gecko/gclenny.ssl @@ -805,7 +805,7 @@ procedure Node940 begin end procedure Node951 begin - if (self_rep_positive and (local_var(LVAR_reaction) > 30) ) then begin + if (perceived_rep_positive and (local_var(LVAR_reaction) > 30) ) then begin call Node021; end else begin diff --git a/scripts_src/headers/upu.h b/scripts_src/headers/upu.h index 7e3481ea6..fb744d0f7 100644 --- a/scripts_src/headers/upu.h +++ b/scripts_src/headers/upu.h @@ -141,29 +141,15 @@ procedure cult_rep begin return rep; end // account for Evil_Critter, absolute "good" value. More is better. -procedure self_rep begin +procedure perceived_rep begin variable rep := beacon_rep; - if rep < 0 and self_is_evil then rep := abs(rep); + if self_is_evil then rep := -rep; if dude_has_cult then rep := abs(rep); return rep; end -#define self_rep_positive (self_rep > 0) -#define self_rep_negative (self_rep < 0) - -// normal mode: critter likes dude if he has title, taking Evil_Critter into account -procedure check_title(variable title) begin - variable rep := cult_rep; - if not self_is_evil and rep >= title then return true; - if self_is_evil and rep <= title then return true; - return false; -end -// inverse mode: critter dislikes dude if he has title, taking Evil_Critter into account -procedure check_title_bad(variable title) begin - variable rep := cult_rep; - if not self_is_evil and rep <= title then return true; - if self_is_evil and rep >= title then return true; - return false; -end +#define perceived_rep_positive (perceived_rep > 0) +#define perceived_rep_negative (perceived_rep < 0) + // call before restock procedure move_quest_items begin diff --git a/scripts_src/klamath/kcsulik.ssl b/scripts_src/klamath/kcsulik.ssl index 611117fa9..02cb60f9c 100644 --- a/scripts_src/klamath/kcsulik.ssl +++ b/scripts_src/klamath/kcsulik.ssl @@ -316,7 +316,7 @@ procedure critter_p_proc begin attack(dude_obj); end else if (Sulik_In_Party) then begin - if self_rep < SULIK_BAD_KARMA then begin + if perceived_rep < SULIK_BAD_KARMA then begin call Node70a; ndebug("Evil Spirit"); end @@ -417,7 +417,7 @@ procedure talk_p_proc begin else if has_rep_slaver then begin call Node071; end - else if self_rep < SULIK_BAD_KARMA then begin + else if perceived_rep < SULIK_BAD_KARMA then begin call Node70a; end else if ((Sulik_In_Party) or (party_is_waiting)) then begin diff --git a/scripts_src/main/ahhakun.ssl b/scripts_src/main/ahhakun.ssl index 3104b671a..9a326ea96 100644 --- a/scripts_src/main/ahhakun.ssl +++ b/scripts_src/main/ahhakun.ssl @@ -268,7 +268,7 @@ procedure talk_p_proc begin kill_critter(self_obj,ANIM_fall_front_sf); end - else if (self_rep_negative or (local_var(LVAR_reaction_level) <= REACTION_LEVEL_BAD)) then begin + else if (perceived_rep_negative or (local_var(LVAR_reaction_level) <= REACTION_LEVEL_BAD)) then begin start_gdialog(NAME,self_obj,4,HEAD_HAKUNIN,BACKGROUND_TENT); gSay_Start; //added by killap diff --git a/scripts_src/modoc/mcbaltha.ssl b/scripts_src/modoc/mcbaltha.ssl index f5070221e..03abc23c9 100644 --- a/scripts_src/modoc/mcbaltha.ssl +++ b/scripts_src/modoc/mcbaltha.ssl @@ -225,9 +225,9 @@ procedure Node996 begin end end procedure Node995 begin - if (town_rep_is_accepted or check_title(KARMA_SHIELD_OF_HOPE)) then begin + if (town_rep_is_accepted or perceived_rep >= KARMA_SHIELD_OF_HOPE) then begin call Node011; - end else if town_rep_is_antipaty or check_title_bad(KARMA_SWORD_OF_DESPAIR) then begin + end else if (town_rep_is_antipaty or perceived_rep <= KARMA_SWORD_OF_DESPAIR) then begin call Node017; end else begin call Node018; diff --git a/scripts_src/navarro/ccxarn.ssl b/scripts_src/navarro/ccxarn.ssl index d83d4a318..43edc4458 100644 --- a/scripts_src/navarro/ccxarn.ssl +++ b/scripts_src/navarro/ccxarn.ssl @@ -432,7 +432,7 @@ procedure Node004 begin end procedure Node005 begin - if not self_rep_negative then begin + if (perceived_rep >= 0) then begin call Node05a; end else begin @@ -453,7 +453,7 @@ procedure Node05b begin end procedure Node05c begin - if not self_rep_negative then begin + if (perceived_rep >= 0) then begin Reply(122); NLowOption(124,Node006); diff --git a/scripts_src/ncr/scmerk.ssl b/scripts_src/ncr/scmerk.ssl index e83630a39..fcc32dde6 100644 --- a/scripts_src/ncr/scmerk.ssl +++ b/scripts_src/ncr/scmerk.ssl @@ -581,7 +581,7 @@ nbody(002) msgNum := 105; else set_merk_status(MERK_STATUS_MET); - if (msgNum == 109 and check_title_bad(KARMA_DEFENDER)) then + if (msgNum == 109 and cult_rep < KARMA_DEFENDER) then msgNum := 105; if (msgNum == 113 and dude_is_male) then msgNum := 105; @@ -595,7 +595,7 @@ nbody(003) msgNum += Random(0, 6); if (msgNum == 115 and not has_rep_childkiller) then msgNum := 114; - if (msgNum == 116 and check_title_bad(KARMA_DEFENDER)) then + if (msgNum == 116 and cult_rep < KARMA_DEFENDER) then msgNum := 114; if (msgNum == 117 and dude_is_male) then msgNum := 114; diff --git a/scripts_src/newreno/ncchrwri.ssl b/scripts_src/newreno/ncchrwri.ssl index db451a490..5ec6f1797 100644 --- a/scripts_src/newreno/ncchrwri.ssl +++ b/scripts_src/newreno/ncchrwri.ssl @@ -205,7 +205,7 @@ end procedure Node999 begin end procedure Node990 begin - if has_rep_berserker or has_rep_childkiller or (self_rep < -100) then begin + if has_rep_berserker or has_rep_childkiller or (perceived_rep < -100) then begin call Node013; end else begin call Node012; diff --git a/scripts_src/newreno/nccody.ssl b/scripts_src/newreno/nccody.ssl index 2896c5d05..f2885c39d 100644 --- a/scripts_src/newreno/nccody.ssl +++ b/scripts_src/newreno/nccody.ssl @@ -218,7 +218,7 @@ procedure talk_p_proc begin start_dialog_at_node(Node016); end else if ((dude_wearing_power_armor) or (has_rep_slaver)) then begin start_dialog_at_node(Node012); - end else if (self_rep < -100) or has_rep_childkiller then begin + end else if (perceived_rep < -100) or has_rep_childkiller then begin start_dialog_at_node(Node013); end else if (marcus_is_dude_companion) then begin start_dialog_at_node(Node014); @@ -328,7 +328,7 @@ end procedure Node003 begin if (Fallout2_enclave_destroyed) then begin Reply(220); - if (self_rep < -100) or has_rep_childkiller then begin + if (perceived_rep < -100) or has_rep_childkiller then begin BOption(223, Node990, -003); BOption(225, Node990, 004); end @@ -507,7 +507,7 @@ procedure Node018 begin NOption(382, Node019, 004); end procedure Node019 begin - if (self_rep < 0) or has_rep_childkiller then begin + if perceived_rep_negative or has_rep_childkiller then begin Reply(391); BOption(393, Node003, -003); BOption(395, Node003, 004); diff --git a/scripts_src/newreno/nckeiwri.ssl b/scripts_src/newreno/nckeiwri.ssl index d369bb2a4..e27148ea0 100644 --- a/scripts_src/newreno/nckeiwri.ssl +++ b/scripts_src/newreno/nckeiwri.ssl @@ -215,7 +215,7 @@ end procedure Node999 begin end procedure Node990 begin - if has_rep_berserker or has_rep_childkiller or (self_rep < -100) then begin + if has_rep_berserker or has_rep_childkiller or (perceived_rep < -100) then begin call Node014; end else if (is_success(roll_vs_skill(dude_obj,SKILL_SPEECH,(-30 * has_rep_slaver)))) then begin call Node013; diff --git a/scripts_src/rndenctr/eccvnmst.ssl b/scripts_src/rndenctr/eccvnmst.ssl index 33f7af760..fe1c796fb 100644 --- a/scripts_src/rndenctr/eccvnmst.ssl +++ b/scripts_src/rndenctr/eccvnmst.ssl @@ -177,11 +177,11 @@ procedure talk_p_proc begin GetReaction; - if ((CITY_START >= 0) and self_rep_negative) then begin + if ((CITY_START >= 0) and perceived_rep_negative) then begin call Node014; end - else if ((CITY_START < 0) and self_rep_negative) then begin + else if ((CITY_START < 0) and perceived_rep_negative) then begin call Node015; end diff --git a/scripts_src/sanfran/fckenlee.ssl b/scripts_src/sanfran/fckenlee.ssl index 09ed990fe..af1ce3044 100644 --- a/scripts_src/sanfran/fckenlee.ssl +++ b/scripts_src/sanfran/fckenlee.ssl @@ -573,7 +573,7 @@ procedure Node004 begin end procedure Node89 begin - if ((neutral_critter_reaction or good_critter_reaction) and check_title(KARMA_BETRAYER)) then + if ((neutral_critter_reaction or good_critter_reaction) and perceived_rep >= KARMA_BETRAYER) then call Node008; else call Node009; diff --git a/scripts_src/template/random_merchant.ssl b/scripts_src/template/random_merchant.ssl index 68177b486..b40a7d9bc 100644 --- a/scripts_src/template/random_merchant.ssl +++ b/scripts_src/template/random_merchant.ssl @@ -140,18 +140,18 @@ procedure talk_p_proc begin else if (Personality < 0) then call Node015; - else if ((CITY_START >= 0) and self_rep_negative) then begin + else if ((CITY_START >= 0) and perceived_rep_negative) then begin call Node012; end - else if ((CITY_START < 0) and self_rep_negative) then begin + else if ((CITY_START < 0) and perceived_rep_negative) then begin call Node009; end else begin start_gdialog(NAME,self_obj,4,-1,-1); gSay_Start; - if ((CITY_START >= 0) and self_rep_positive) then + if ((CITY_START >= 0) and (perceived_rep >= 0)) then call Node010; else call Node011; diff --git a/scripts_src/valtcity/vcamanda.ssl b/scripts_src/valtcity/vcamanda.ssl index f2306e5c6..83a2be7ff 100644 --- a/scripts_src/valtcity/vcamanda.ssl +++ b/scripts_src/valtcity/vcamanda.ssl @@ -200,7 +200,7 @@ procedure talk_p_proc begin if ( (global_var(GVAR_QUEST_JOSHUA) == JOSHUA_UNKNOWN) and (dude_iq < 4) ) then call Node005; else if( (global_var(GVAR_QUEST_JOSHUA) == JOSHUA_UNKNOWN) and - (self_rep_negative or has_rep_slaver or has_rep_childkiller or (local_var(LVAR_Amanda_Pissed) == 1) )) then + (perceived_rep_negative or has_rep_slaver or has_rep_childkiller or (local_var(LVAR_Amanda_Pissed) == 1) )) then call Node006; else if( global_var(GVAR_QUEST_JOSHUA) == JOSHUA_UNKNOWN ) then begin start_gdialog(NAME,self_obj,4,-1,-1); diff --git a/scripts_src/valtcity/vccasidy.ssl b/scripts_src/valtcity/vccasidy.ssl index ea50ed3f0..6ce4886f6 100644 --- a/scripts_src/valtcity/vccasidy.ssl +++ b/scripts_src/valtcity/vccasidy.ssl @@ -468,7 +468,7 @@ end procedure Node001a begin set_local_var( LVAR_Cassidy_Offered, 1 ); - if ( (dude_charisma == 1) or has_rep_slaver or has_rep_childkiller or check_title_bad(-100) or dude_at_max_party_size ) then + if ( (dude_charisma == 1) or has_rep_slaver or has_rep_childkiller or (perceived_rep < -100) or dude_at_max_party_size ) then call Node015; else call Node016; @@ -591,14 +591,14 @@ procedure Node015 begin Reply(157); else if( has_rep_slaver ) then Reply(158); - else if ( has_rep_childkiller or check_title_bad(-100) ) then + else if ( has_rep_childkiller or (perceived_rep < -100) ) then Reply(159); else Reply(160); - if (self_rep >= -100) and (not has_rep_slaver) and (not has_rep_childkiller) and (dude_charisma > 1) then + if (perceived_rep >= -100) and (not has_rep_slaver) and (not has_rep_childkiller) and (dude_charisma > 1) then NOption(161, Node999, 004); - if (self_rep < -100) or has_rep_slaver or has_rep_childkiller or (dude_charisma == 1) then begin + if (perceived_rep < -100) or has_rep_slaver or has_rep_childkiller or (dude_charisma == 1) then begin BOption(162, Node999, 004); NOption(163, Node999, 004); end @@ -728,7 +728,7 @@ procedure Node1100 begin Reply(2100); BOption(3100, Node999, 001); //added by killap NOption(3200, Node999, 001); //added by killap - end else if (has_rep_childkiller or check_title_bad(-100)) then begin + end else if( has_rep_childkiller or (perceived_rep < -100) ) then begin set_self_abandon_party; //added by killap Reply(2200); BOption(3100, Node999, 001); //added by killap diff --git a/scripts_src/vault13/ocgoris.ssl b/scripts_src/vault13/ocgoris.ssl index b29a14473..c21a851f4 100644 --- a/scripts_src/vault13/ocgoris.ssl +++ b/scripts_src/vault13/ocgoris.ssl @@ -281,7 +281,7 @@ procedure critter_p_proc begin if (Goris_In_Party and self_visible) then begin party_member_follow_dude - if has_rep_berserker or has_rep_childkiller or self_rep_negative then begin + if has_rep_berserker or has_rep_childkiller or perceived_rep_negative then begin float_msg(self_obj, mstr(1160), FLOAT_MSG_RED); set_self_abandon_party; set_self_team(TEAM_VAULT13); @@ -729,7 +729,7 @@ procedure Node013 begin end procedure Node014 begin - if not (self_rep_negative or town_rep_negative or has_rep_childkiller or has_rep_berserker) then begin + if not (perceived_rep_negative or town_rep_negative or has_rep_childkiller or has_rep_berserker) then begin ndebug("true_party_size " + true_party_size); ndebug("party_max_formula " + party_max_formula); ndebug("((true_party_size >= (party_max_formula)) or (true_party_size >= 5)): " + ((true_party_size >= (party_max_formula)) or (true_party_size >= 5))); @@ -884,7 +884,7 @@ end NOption(1012, Node1003, 4); \ NOption(1166, Node1007, 4); \ if (party_is_waiting) then \ - NOption(1016, Node1100, 4); /* edit by killap - was NLowOption */ \ + NOption(1016, Node1100, 4); /* edit by killap - was NLowOption */ \ if (lvar(LVAR_First_Combat) >= 1 and not lvar_bit(LVAR_State, STATE_TALK_DCLAW) ) then \ NOption(1017, Node022, 4); \ NOption(1018, Node999, 4) diff --git a/scripts_src/vault13/ocgrutha.ssl b/scripts_src/vault13/ocgrutha.ssl index 14d19cc16..7ca7169ad 100644 --- a/scripts_src/vault13/ocgrutha.ssl +++ b/scripts_src/vault13/ocgrutha.ssl @@ -130,7 +130,7 @@ import variable i_matt_obj; import variable i_gruthar_obj; #define GRUTHAR_NO_LIKE_YOU \ - (bad_critter_reaction or self_rep_negative or town_rep_negative or has_rep_childkiller or has_rep_berserker) + (bad_critter_reaction or perceived_rep_negative or town_rep_negative or has_rep_childkiller or has_rep_berserker) #define STARTTILE 14695