-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d3972e
commit 7b82919
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* - Expands awareness perk effect by printing target's armor stats. | ||
*/ | ||
|
||
#include "../sfall/command_lite.h" | ||
#include "../sfall/define_lite.h" | ||
#include "../sfall/define_extra.h" | ||
#include "../sfall/sfall.h" | ||
|
||
#define SCRIPT_REALNAME "pbs_awareness_expanded" | ||
|
||
#include "../_pbs_headers/ecco_log.h" | ||
#include "../_pbs_headers/ecco_ini.h" | ||
#include "../_pbs_headers/ecco_msg.h" | ||
|
||
/* | ||
procedure description_hook begin | ||
display_msg("desc "+obj_name(get_sfall_arg)); | ||
end | ||
*/ | ||
|
||
#define critter_is_biped(cr) (proto_data(obj_pid(cr), cr_body_type) == CR_BODY_BIPED) | ||
|
||
procedure mstr_dmg_resist(variable obj, variable dmgType) begin | ||
variable | ||
formatStr := mstr_ecco_combat(410), | ||
dmgTypeStr := mstr_ecco_combat(420 + dmgType), | ||
dt := get_critter_stat(obj, STAT_dmg_thresh + dmgType), | ||
dr := get_critter_stat(obj, STAT_dmg_resist + dmgType); | ||
|
||
return string_format(formatStr, dt, dr, dmgTypeStr); | ||
end | ||
|
||
procedure stdprocedure_end_hook begin | ||
variable proc := get_sfall_arg, obj := get_sfall_arg; | ||
if (proc == description_proc and obj != dude_obj and obj_type(obj) == OBJ_TYPE_CRITTER | ||
and dude_perk(PERK_bonus_awareness) and not is_critter_dead(obj)) then begin | ||
variable | ||
//dmgType := obj_pid get_active_weapon(dude_obj) | ||
ac := get_critter_stat(obj, STAT_ac), | ||
msg := mstr_ecco_combat(400 + get_gender(obj) if critter_is_biped(obj) else 402) | ||
+ mstr_dmg_resist(obj, DMG_normal_dam) | ||
+ mstr_dmg_resist(obj, DMG_laser) | ||
+ mstr_dmg_resist(obj, DMG_fire) | ||
+ mstr_dmg_resist(obj, DMG_plasma) | ||
+ mstr_dmg_resist(obj, DMG_explosion) | ||
+ string_format(mstr_ecco_combat(411), ac); | ||
|
||
display_msg(msg); | ||
end | ||
end | ||
|
||
#define INI_FILE INI_MISC | ||
#define INI_SECTION "AWARENESS" | ||
|
||
procedure start begin | ||
if not game_loaded then return; | ||
if (not get_ini_value_def(INI_FILE, INI_SECTION, "display_extra_info", false)) then return; | ||
|
||
register_hook_proc(HOOK_STDPROCEDURE_END, stdprocedure_end_hook); | ||
//register_hook_proc(HOOK_DESCRIPTIONOBJ, description_hook); | ||
end | ||
|