Skip to content

Commit

Permalink
- Pathfinder now affects WM travel speed
Browse files Browse the repository at this point in the history
- Added party_highest_skill_level to quickly grab highest skill value.. in the party
  • Loading branch information
Lexx2k committed May 12, 2024
1 parent 078c60c commit d73a037
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ procedure general begin
call gecko_skinning;
end

procedure GameModeChange_handler begin#
procedure GameModeChange_handler begin
if (get_game_mode bwand CHARSCREEN) then begin
// Reset player animation for the hero appearance mod
reg_anim_clear(dude_obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ procedure Encounter_handler begin
end

procedure start begin
variable terrain_time, time, skill, test;
variable terrain_time, time, skill;

if (game_loaded) then begin
set_global_script_type(2);
Expand All @@ -262,7 +262,9 @@ variable terrain_time, time, skill, test;
if fo1in2_radiation_enabled then call SetRadiation;

// Override Fo2 wm travel time to match Fo1 more closely
skill := has_skill(dude_obj, SKILL_OUTDOORSMAN);
//skill := has_skill(dude_obj, SKILL_OUTDOORSMAN);
skill := party_highest_skill_level(SKILL_OUTDOORSMAN);

if (skill > 100) then skill := 100;

// Add flat +20 if player has a motion sensor or the Eyebot is in the party
Expand All @@ -280,8 +282,8 @@ variable terrain_time, time, skill, test;
else begin
terrain_time := 0.408; // 10h
end
time := ((-0.0075717243419 * skill + 1.75717243419) * terrain_time);
time := ((-0.0075717243419 * skill + 1.75717243419) * terrain_time) * (1 - dude_perk(PERK_pathfinder) * 0.25);

//debug("terrain_time: " + terrain_time);
//debug("terrain_time: " + time);
set_map_time_multi(time);
end
18 changes: 18 additions & 0 deletions Fallout2/Fallout1in2/Mapper/source/scripts/headers/party.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include "sfall/sfall.h"

/***************************************************************
The following contain all of the Party information and
commands for Fallout 2
Expand Down Expand Up @@ -695,3 +697,19 @@ procedure checkPartyMembersNearDoor begin
CHECKMEMBERNEARDOOR(Vasquez_In_Party, Vasquez_ptr)
return 0;
end

/***************************************************************************************
Get who has the highest skill in the party
****************************************************************************************/
procedure get_highest_skill_in_party(variable skill) begin
variable who, max;
foreach (who in party_member_list_critters) begin
if (has_skill(who, skill) > max) then begin
max := has_skill(who, skill);
end
end
return max;
end

#define party_highest_skill_level(x) \
get_highest_skill_in_party(x)

1 comment on commit d73a037

@Slagar80
Copy link
Contributor

@Slagar80 Slagar80 commented on d73a037 May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pathfinder in vanilla Fallout 1+2 is supposed to already make the in game time pass 25 % slower (instead of making the player faster) when traveling on the wm,now this change makes the player also travel 25 % faster with the perk when on the wm.

https://fallout.fandom.com/wiki/Pathfinder

Was this on purpose or was the change added bc you weren’t aware of the slower passing of in game time already implemented by the perk as the perk description (which you can check in the wiki) states that it makes the time pass slower and not make the player faster.

Please sign in to comment.