Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Source file
SCRIPTS.LST comment Military Base Power Generator
MSG file N/A
Transcript

/*
        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/******************************************************************************************
        Item: Wood Door
        Locked: Yes
        Trapped: Yes
        Description: This is a generic locked and trapped wooden door.
        Log:
           Please note any changes that have been made to the file in Updated. Then comment
           the code which you have changed/altered/commented out. Please, do not delete any
           code which was written.
           Created: September 26, 1997
           Updated:
******************************************************************************************/
/* Include Files */
#include "..\headers\define.h"
#define NAME SCRIPT_ESPWRGEN
#include "..\headers\UpdatMap.h"
#include "..\headers\command.h"
#include "..\headers\base.h"
/* Defines and Macros */
#define REPAIR_BONUS (-30)
#define TOOL_BONUS (REPAIR_BONUS+20)
#define REPAIR_MIN (50)
procedure start;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
#define LVAR_Gave_Xp (0)
#define LVAR_Failed_Attempts (1)
procedure start begin
end
procedure use_skill_on_p_proc begin
   if (not(Generator_Fixed)) then begin
      script_overrides;
      if (has_skill(source_obj,SKILL_REPAIR) < 50) then begin
         display_msg(mstr(104));
      end else if (skill_success(source_obj,SKILL_REPAIR,REPAIR_BONUS)) then begin
         set_base_power;
         display_msg(mstr(108));
         base_lighting;
         if (local_var(LVAR_Gave_Xp) == 0) then begin
            display_mstr(200);
            give_xp(EXP_MILITARY_BASE_FIX_GENERATOR);
            set_local_var(LVAR_Gave_Xp,1);
         end
      end else begin
         inc_local_var(LVAR_Failed_Attempts);
         if (local_var(LVAR_Failed_Attempts) == 1) then
            display_msg(mstr(105));
         else if (local_var(LVAR_Failed_Attempts) == 2) then
            display_msg(mstr(106));
         else
            display_msg(mstr(107));
      end
   end
end
procedure use_obj_on_p_proc begin
   if ((not(Generator_Fixed)) and (obj_pid(obj_being_used_with) == PID_MULTI_TOOL)) then begin
      script_overrides;
      if (has_skill(source_obj,SKILL_REPAIR) < 50) then begin
         display_msg(mstr(104));
      end else if (skill_success(source_obj,SKILL_REPAIR,TOOL_BONUS)) then begin
         set_base_power;
         display_msg(mstr(108));
         base_lighting;
         if (local_var(LVAR_Gave_Xp) == 0) then begin
            display_mstr(200);
            give_xp(EXP_MILITARY_BASE_FIX_GENERATOR);
            set_local_var(LVAR_Gave_Xp,1);
         end
      end else begin
         inc_local_var(LVAR_Failed_Attempts);
         if (local_var(LVAR_Failed_Attempts) == 1) then
            display_msg(mstr(105));
         else if (local_var(LVAR_Failed_Attempts) == 2) then
            display_msg(mstr(106));
         else
            display_msg(mstr(107));
      end
   end
end
procedure look_at_p_proc begin
   script_overrides;
   if (Generator_Fixed) then begin
       display_msg(mstr(102));
   end else begin
       display_msg(mstr(100));
   end
end
procedure description_p_proc begin
   script_overrides;
   if (Generator_Fixed) then begin
       display_msg(mstr(103));
   end else begin
       display_msg(mstr(101));
   end
end

Advertisement