/*
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/******************************************************************************************
Item: Power Generator
Description: It can be fixed.
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_BSPOWER
#define CUR_COMP_SCRIPT SCRIPT_BSPOWER
#include "..\headers\command.h"
#include "..\headers\vault15.h"
#include "..\headers\v15.h"
/* Standard Script Procedures */
procedure start;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;
/*****************************************************************
Local Variables which are saved. All Local Variables need to be
prepended by LVAR_
*****************************************************************/
#define TOOL_BONUS 10
#define SUPER_TOOLKIT_BONUS 50
/*******************************************************************
Imported variables from the Map scripts. These should only be
pointers and variables that need not be saved. If a variable
Needs to be saved, make it a map variable (MVAR_)
*******************************************************************/
/*******************************************************************
Local variables which do not need to be saved between map changes.
*******************************************************************/
#define LVAR_Diagnose (0)
/*******************************************************************
******* PROCEDURES *******
*******************************************************************/
/*******************************************************************
The start procedure is the first procedure called when the map is
first entered. Any initial information that needs to be set up
should be placed in here.
*******************************************************************/
procedure start begin
end
procedure timed_event_p_proc begin
end
/********************************************************************
********************************************************************/
procedure use_p_proc begin
end
/***************************************************************************
This is cursory glance description that the player will receive should
he just pass the Action Cursor over. Examines which give more information
need to be in the description_p_proc procedure.
***************************************************************************/
procedure look_at_p_proc begin
end
/**********************************************************************************
**********************************************************************************/
procedure description_p_proc begin
script_overrides;
if (map_var(MVAR_Vault15_Power)) then
display_msg(mstr(100));
else
display_msg(mstr(101));
end
/**********************************************************************************
Make sure the door is working.
**********************************************************************************/
procedure use_skill_on_p_proc begin
variable Skill_Used;
Skill_Used:=action_being_used;
if (Skill_Used == SKILL_SCIENCE) then begin
script_overrides;
if (skill_success(dude_obj, Skill_Used, 0)) then begin
set_local_var(LVAR_Diagnose, 1);
display_msg(mstr(104));
end else begin
display_msg(mstr(105));
end
end else if (Skill_Used == SKILL_REPAIR) then begin
if (map_var(MVAR_Vault15_Power) == 0) then begin
script_overrides;
if (local_var(LVAR_Diagnose) == 1) then begin
if (skill_success(dude_obj, Skill_Used, 0)) then begin
set_map_var(MVAR_Vault15_Power, 1);
set_map_var(MVAR_Vault15_Field, map_var(MVAR_Vault15_Field) bwor FIELD_ON);
debug_msg("BSPOWER: set power on set field to field_on");
give_xp(EXP_FIXED_GENERATOR);
display_msg(mstr(108));
end else begin
display_msg(mstr(109));
end
end else begin
display_msg(mstr(105));
end
end
end
end
/**********************************************************************************
This is called when the player is using an object on the door. When the check is
made to find out what is being used, obj_pid(obj_being_used_with) will need to
be checked against a prototype.
**********************************************************************************/
procedure use_obj_on_p_proc begin
variable tool;
variable RepairBonus;
tool := obj_pid(obj_being_used_with);
if (tool == PID_MULTI_TOOL) then begin
RepairBonus := TOOL_BONUS;
end else if (tool == PID_SUPER_TOOL_KIT) then begin
RepairBonus := SUPER_TOOLKIT_BONUS;
end
if (RepairBonus) then begin
if (map_var(MVAR_Vault15_Power) == 0) then begin
script_overrides;
if (local_var(LVAR_Diagnose) == 1) then begin
if (skill_success(dude_obj, SKILL_REPAIR, RepairBonus)) then begin
set_map_var(MVAR_Vault15_Power, 1);
set_map_var(MVAR_Vault15_Field, map_var(MVAR_Vault15_Field) bwor FIELD_ON);
debug_msg("BSPOWER: set power on set field to field_on");
give_xp(EXP_FIXED_GENERATOR);
display_msg(mstr(108));
end else begin
display_msg(mstr(109));
end
end else begin
display_msg(mstr(105));
end
end
end
end
/******************************************************************************************
IF it gets damaged it breaks
******************************************************************************************/
procedure damage_p_proc begin
end
/***************************************************************************************
Whenever the map is first entered, this procedure will be called.
***************************************************************************************/
procedure map_enter_p_proc begin
end
/**************************************************************************************
This procedure gets called roughly every 30 seconds of real time.
**************************************************************************************/
procedure map_update_p_proc begin
end
/**************************************************************************************
This is used for any dialogue that may need to occur with the player.
**************************************************************************************/
procedure talk_p_proc begin
end