Skip to content

Commit

Permalink
Fixed and unified float events for party members
Browse files Browse the repository at this point in the history
* Sulik, Lenny, Goris, Davin, Miria didn't have the event repeating
like others.
* Now the interval of floats is 60-90 sec for all party members (not
spamming but also not too few).
* Removed unnecessary newr1.h include for party members (was for old
sex drug fix).
  • Loading branch information
NovaRain committed Sep 30, 2024
1 parent 5b5a67f commit f7de0e3
Show file tree
Hide file tree
Showing 14 changed files with 191 additions and 216 deletions.
57 changes: 25 additions & 32 deletions scripts_src/brokhill/hcmarcus.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "../headers/define.h"
#include "../headers/broken.h"
#include "../headers/broken1.h"
#include "../headers/newr1.h" //added by killap

#define NAME SCRIPT_HCMARCUS
#define TOWN_REP_VAR (GVAR_TOWN_REP_BROKEN_HILLS)
Expand All @@ -52,7 +51,6 @@ procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_update_p_proc;
procedure map_enter_p_proc;
procedure timed_event_p_proc;
procedure combat;
Expand Down Expand Up @@ -273,7 +271,7 @@ procedure map_enter_p_proc begin

if (Marcus_In_Party) then begin
Perform_Critter_Float := 1;
add_timer_event( self_obj, game_ticks( random(40, 50) ), 1);
flush_add_timer_event_sec(self_obj, random(40, 50), 1);
end
else begin
Perform_Critter_Float := 0;
Expand All @@ -287,15 +285,11 @@ procedure map_enter_p_proc begin
end
end

procedure map_update_p_proc begin
end

procedure push_p_proc begin
call Node2001;
end

procedure timed_event_p_proc begin
variable count;
// 1 - Standard Floats
if( fixed_param == 1 ) then begin
if( ( not( combat_is_initialized ) ) and
Expand Down Expand Up @@ -323,35 +317,35 @@ procedure timed_event_p_proc begin
call Node2015;
end
end
add_timer_event( self_obj, game_ticks( random(100, 125) ), 1); //edit by killap - was (40,50)
flush_add_timer_event_sec(self_obj, random(60, 90), 1); //edit by killap - was (40,50)
end else if ( fixed_param == 2 ) then begin
if (series == 1) then begin
series := 2;
floater(40001);
add_timer_event(self_obj,game_ticks(5),2);
series := 2;
floater(40001);
add_timer_event(self_obj,game_ticks(5),2);
end else if (series == 2) then begin
series := 3;
float_msg(Chad_Ptr, mstr(40002), FLOAT_MSG_NORMAL);
add_timer_event(self_obj,game_ticks(3),2);
series := 3;
float_msg(Chad_Ptr, mstr(40002), FLOAT_MSG_NORMAL);
add_timer_event(self_obj,game_ticks(3),2);
end else if (series == 3) then begin
series := 0;
gfade_out(600);
game_ui_enable;
move_to(self_obj, 18284, 0 );
move_to(dude_obj, 18287, 0 );
reg_anim_clear( self_obj );
self_rotate(3);
//anim(self_obj, ANIMATE_ROTATION, 0 );
call Put_Chad_In_Jail;
gfade_in(600);
floater(40000);
display_msg(mstr(40003));
give_xp(1500);
inc_general_rep(5);
inc_global_var_amt(GVAR_TOWN_REP_BROKEN_HILLS,5);
series := 0;
gfade_out(600);
game_ui_enable;
move_to(self_obj, 18284, 0 );
move_to(dude_obj, 18287, 0 );
reg_anim_clear( self_obj );
self_rotate(3);
//anim(self_obj, ANIMATE_ROTATION, 0 );
call Put_Chad_In_Jail;
gfade_in(600);
floater(40000);
display_msg(mstr(40003));
give_xp(1500);
inc_general_rep(5);
inc_global_var_amt(GVAR_TOWN_REP_BROKEN_HILLS,5);
end
end
//end added
end
//end added
end

/* Every heartbeat that the critter gets, this procedure will be called. Anything from
Expand Down Expand Up @@ -414,7 +408,6 @@ end
written by designers are placed in here. Additionally, Reactions are generated and
stored which affects player interactions. */
procedure talk_p_proc begin

Evil_Critter:=0;
Slavery_Tolerant:=SLAVE_INTOLERANT;
Karma_Perception:=KARMA_PERCEPTION3;
Expand Down
5 changes: 2 additions & 3 deletions scripts_src/den/dcvic.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "../headers/command.h"
#include "../headers/modreact.h"
#include "../headers/den.h"
#include "../headers/newr1.h" //added by killap

/* Standard Script Procedures */
procedure start;
Expand Down Expand Up @@ -216,7 +215,7 @@ procedure timed_event_p_proc begin
end
end
end
flush_add_timer_event_sec(self_obj, random(45, 90), timed_event_float); //edit by killap - was (15,30)
flush_add_timer_event_sec(self_obj, random(60, 90), timed_event_float); //edit by killap - was (15,30)
end
else if (fixed_param == TIMER_ENSURE_ANIM) then begin
if not anim_busy(self_obj) then begin
Expand All @@ -243,7 +242,7 @@ procedure timed_event_p_proc begin
end
end
end
add_timer_event(self_obj, game_ticks(1), TIMER_ENSURE_ANIM);
add_timer_event(self_obj, game_ticks(1), TIMER_ENSURE_ANIM);
end
end

Expand Down
108 changes: 53 additions & 55 deletions scripts_src/epa/epac10.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "../headers/command.h"
#include "../headers/modreact.h"
#include "../headers/newr1.h"
#include "../headers/epasl.h"

#define PARTY_NODE_X Node1000
Expand Down Expand Up @@ -308,23 +307,23 @@ procedure use_obj_on_p_proc begin
end

if (Dex_In_Party) then begin
if ( (obj_pid(obj_being_used_with) == PID_FIRST_AID_KIT) or
(obj_pid(obj_being_used_with) == PID_DOCTORS_BAG) or
(obj_pid(obj_being_used_with) == PID_RADAWAY) or
(obj_pid(obj_being_used_with) == PID_ANTIDOTE) or
(obj_pid(obj_being_used_with) == PID_STIMPAK) or
(obj_pid(obj_being_used_with) == PID_SUPER_STIMPAK) ) then
call Node2009;
else if( (obj_pid(obj_being_used_with) == PID_BEER ) or
(obj_pid(obj_being_used_with) == PID_BOOZE ) or
(obj_pid(obj_being_used_with) == PID_ROT_GUT ) or
(obj_pid(obj_being_used_with) == PID_ROENTGEN_RUM ) or
(obj_pid(obj_being_used_with) == PID_GAMMA_GULP_BEER ) or
( obj_pid(obj_being_used_with) == PID_PSYCHO ) or
( obj_pid(obj_being_used_with) == PID_BUFFOUT ) or
( obj_pid(obj_being_used_with) == PID_MENTATS ) or
( obj_pid(obj_being_used_with) == PID_JET ) ) then
call Node2003;
if ( (obj_pid(obj_being_used_with) == PID_FIRST_AID_KIT) or
(obj_pid(obj_being_used_with) == PID_DOCTORS_BAG) or
(obj_pid(obj_being_used_with) == PID_RADAWAY) or
(obj_pid(obj_being_used_with) == PID_ANTIDOTE) or
(obj_pid(obj_being_used_with) == PID_STIMPAK) or
(obj_pid(obj_being_used_with) == PID_SUPER_STIMPAK) ) then
call Node2009;
else if( (obj_pid(obj_being_used_with) == PID_BEER ) or
(obj_pid(obj_being_used_with) == PID_BOOZE ) or
(obj_pid(obj_being_used_with) == PID_ROT_GUT ) or
(obj_pid(obj_being_used_with) == PID_ROENTGEN_RUM ) or
(obj_pid(obj_being_used_with) == PID_GAMMA_GULP_BEER ) or
(obj_pid(obj_being_used_with) == PID_PSYCHO) or
(obj_pid(obj_being_used_with) == PID_BUFFOUT) or
(obj_pid(obj_being_used_with) == PID_MENTATS) or
(obj_pid(obj_being_used_with) == PID_JET) ) then
call Node2003;
end

end
Expand Down Expand Up @@ -478,47 +477,46 @@ procedure Node902 begin
end

procedure timed_event_p_proc begin
if (self_visible) then begin
if (combat_is_initialized == false) then begin
if (Dex_In_Party == false) then begin
//blah
end else begin
if (party_healed_bad) then begin
call Node2001;
end else if (self_is_poisoned) then begin
call Node2006;
end else if (self_rads > 0) then begin
call Node2002;
end else if (Is_Crippled(self_obj)) then begin
call Node2007;
end else if (Is_Blind(self_obj)) then begin
call Node2008;
end else if ( (Sulik_In_Party) and (random(1,2) == 2) ) then begin
call Node2100;
end else if ( (Vic_In_Party) and (random(1,2) == 2) ) then begin
call Node2101;
end else if ( (Miria_In_Party) and (random(1,2) == 2) ) then begin
call Node2102;
end else if ( (Davin_In_Party) and (random(1,2) == 2) ) then begin
call Node2103;
end else if ( (MacRae_In_Party) and (random(1,2) == 2) ) then begin
call Node2104;
end else if ( (Lenny_In_Party) and (random(1,2) == 2) ) then begin
call Node2105;
end else if ( (Marcus_In_Party) and (random(1,2) == 2) ) then begin
call Node2106;
end else if ( (Myron_In_Party) and (random(1,2) == 2) ) then begin
call Node2107;
end else if ( (Goris_In_Party) and (random(1,2) == 2) ) then begin
call Node2108;
if (self_visible) then begin
if (combat_is_initialized == false) then begin
if (Dex_In_Party == false) then begin
//blah
end else begin
call Node2000;
if (party_healed_bad) then begin
call Node2001;
end else if (self_is_poisoned) then begin
call Node2006;
end else if (self_rads > 0) then begin
call Node2002;
end else if (Is_Crippled(self_obj)) then begin
call Node2007;
end else if (Is_Blind(self_obj)) then begin
call Node2008;
end else if ( (Sulik_In_Party) and (random(1,2) == 2) ) then begin
call Node2100;
end else if ( (Vic_In_Party) and (random(1,2) == 2) ) then begin
call Node2101;
end else if ( (Miria_In_Party) and (random(1,2) == 2) ) then begin
call Node2102;
end else if ( (Davin_In_Party) and (random(1,2) == 2) ) then begin
call Node2103;
end else if ( (MacRae_In_Party) and (random(1,2) == 2) ) then begin
call Node2104;
end else if ( (Lenny_In_Party) and (random(1,2) == 2) ) then begin
call Node2105;
end else if ( (Marcus_In_Party) and (random(1,2) == 2) ) then begin
call Node2106;
end else if ( (Myron_In_Party) and (random(1,2) == 2) ) then begin
call Node2107;
end else if ( (Goris_In_Party) and (random(1,2) == 2) ) then begin
call Node2108;
end else begin
call Node2000;
end
end
end
end
end

flush_add_timer_event_sec(self_obj, random(90, 120), 1);
flush_add_timer_event_sec(self_obj, random(60, 90), 1);
end

procedure Node000 begin
Expand Down
59 changes: 28 additions & 31 deletions scripts_src/epa/epac11.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define SCRIPT_REALNAME "epac11"
#include "../headers/define.h"
#include "../headers/epamain.h"
#include "../headers/newr1.h" //added by killap
#include "../headers/epasl.h"

#define NAME SCRIPT_EPAC11 //Script name from scripts.h
Expand Down Expand Up @@ -158,8 +157,7 @@ procedure description_p_proc begin
display_msg(mstr(101));
end

procedure use_skill_on_p_proc
begin
procedure use_skill_on_p_proc begin
end

procedure use_obj_on_p_proc begin
Expand All @@ -171,8 +169,7 @@ procedure use_obj_on_p_proc begin

end

procedure damage_p_proc
begin
procedure damage_p_proc begin
end

procedure map_enter_p_proc begin
Expand Down Expand Up @@ -583,34 +580,34 @@ procedure Node5004 begin
end

procedure timed_event_p_proc begin
if (self_visible) then begin
if (combat_is_initialized == false) then begin
if (Cat_Jules_In_Party == false) then begin
//blah
end else begin
if (party_healed_bad) then begin
call Node5000;
end else if (self_is_poisoned) then begin
call Node5001;
end else if (self_rads > 0) then begin
call Node5002;
end else if (Is_Crippled(self_obj)) then begin
call Node5003;
end else if (Is_Blind(self_obj)) then begin
call Node5004;
end else if ( (Myron_In_Party) and (random(1,2) == 2) ) then begin
call Node3000;
end else if ( (Sulik_In_Party) and (random(1,2) == 2) ) then begin
call Node3001;
end else if ( (Lenny_In_Party) and (random(1,2) == 2) ) then begin
call Node3002;
end else if ( (Marcus_In_Party) and (random(1,2) == 2) ) then begin
call Node3003;
if (self_visible) then begin
if (combat_is_initialized == false) then begin
if (Cat_Jules_In_Party == false) then begin
//blah
end else begin
call Node3500;
if (party_healed_bad) then begin
call Node5000;
end else if (self_is_poisoned) then begin
call Node5001;
end else if (self_rads > 0) then begin
call Node5002;
end else if (Is_Crippled(self_obj)) then begin
call Node5003;
end else if (Is_Blind(self_obj)) then begin
call Node5004;
end else if ( (Myron_In_Party) and (random(1,2) == 2) ) then begin
call Node3000;
end else if ( (Sulik_In_Party) and (random(1,2) == 2) ) then begin
call Node3001;
end else if ( (Lenny_In_Party) and (random(1,2) == 2) ) then begin
call Node3002;
end else if ( (Marcus_In_Party) and (random(1,2) == 2) ) then begin
call Node3003;
end else begin
call Node3500;
end
end
end
end
end
flush_add_timer_event_sec(self_obj, random(90, 120), 1);
flush_add_timer_event_sec(self_obj, random(60, 90), 1);
end
Loading

0 comments on commit f7de0e3

Please sign in to comment.