Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Mar 10, 2024
1 parent 58d5c79 commit b4300a4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
36 changes: 35 additions & 1 deletion scripts_src/enclave/qcturret.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,27 @@ procedure map_enter_p_proc;
procedure Security_Check;
procedure damage_p_proc; //added by killap
procedure get_gvar_security;
procedure update_stance;

import variable Frank_Ptr;
variable countdown;
variable gvar_security = GVAR_ENCLAVE_TURRET_MAIN;

/**
* Used to track when maintenance status changes, to animate stand down/up. Nothing more.
* Actual behaviour is controlled by global_var(gvar_security).
*/
#define LVAR_maintenance 0

/**
* Put guns down, indicating to the player that turrets are in maintenance.
*/
#define stand_down \
reg_anim_clear(self_obj); \
reg_anim_begin(); \
reg_anim_animate(self_obj,ANIM_fall_back,-1); \
reg_anim_end()

procedure start begin
gvar_security = get_gvar_security;
end
Expand Down Expand Up @@ -79,7 +95,25 @@ procedure get_gvar_security begin
return ret;
end

/**
* Animate stand up/down, visually indicating maintenance status to the player.
*/
procedure update_stance begin
if (global_var(gvar_security) == TURRET_MAINTENANCE) and (local_var(LVAR_maintenance) != true) then begin
set_local_var(LVAR_maintenance, true);
ndebug("standing down");
stand_down;
end
if (global_var(gvar_security) != TURRET_MAINTENANCE) and (local_var(LVAR_maintenance) == true) then begin
set_local_var(LVAR_maintenance, false);
ndebug("standing up");
animate_stand;
end
end

procedure critter_p_proc begin
call update_stance;

// Maintenance: sleep for 1-3 minutes. See terminal qiturtrm.ssl.
if global_var(gvar_security) == TURRET_MAINTENANCE then begin
set_self_team(TEAM_LONER);
Expand Down Expand Up @@ -175,6 +209,6 @@ end
procedure combat_p_proc begin
if (fixed_param == COMBAT_SUBTYPE_TURN) and (global_var(gvar_security) == TURRET_MAINTENANCE) then begin
script_overrides;
ndebug("I am disabled and won't attack!");
ndebug("I am in maintenance and won't attack!");
end
end
2 changes: 1 addition & 1 deletion scripts_src/enclave/qiturtrm.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ end
procedure use_p_proc begin
script_overrides;

if ((is_skill_tagged(SKILL_SCIENCE)) or (skill_success(dude_obj,SKILL_SCIENCE,-70))) then // Seraph's Fix: is_skill_tagged only takes one parameter. Thanks Rob! Also changed from SKILL_SNEAK to SKILL_SCIENCE - killap
if is_skill_tagged(SKILL_SCIENCE) or skill_success(dude_obj, SKILL_SCIENCE, -70) then
Needed_IQ:=4;
else
Needed_IQ:=6;
Expand Down

0 comments on commit b4300a4

Please sign in to comment.