Combat
Subcategories
Functions
- attack_is_aimed
- block_combat
- combat_data
- disable_aimed_shots
- force_aimed_shots
- get_attack_type
- get_bodypart_hit_modifier
- get_critical_table
- get_critter_current_ap
- get_last_attacker
- get_last_target
- reset_critical_table
- set_bodypart_hit_modifier
- set_critical_table
- set_critter_burst_disable
- set_critter_current_ap
attack_is_aimed
sfall.h
bool attack_is_aimed()
Returns 1 if the aimed attack mode is selected, 0 otherwise.
block_combat
void block_combat(bool value)
Deny the player to enter combat mode.
combat_data
mixed combat_data
- returns a pointer to the
C_ATTACK_*
data for the current combat attack process (see defined constants indefine_extra.h
) - can be used in conjunction with the
get_object_data
andset_object_data
functions example:sfall_func3("set_object_data", sfall_func0("combat_data"), C_ATTACK_UNUSED, 255);
disable_aimed_shots
void disable_aimed_shots(int pid)
Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) stops a weapon from making aimed shots even if it normally coulld. Affects player and NPCs alike. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed.
force_aimed_shots
void force_aimed_shots(int pid)
Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) Will allow a weapon to make aimed shots even if it normally couldn’t. Affects player and NPCs alike. Does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed.
get_attack_type
int get_attack_type
get_bodypart_hit_modifier
int get_bodypart_hit_modifier(int bodypart)
Gets the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8.
get_critical_table
int get_critical_table(int crittertype, int bodypart, int level, int valuetype)
Gets current critical table. For details see critical hit tables. Requires OverrideCriticalTable
to be set to 1 in ddraw.ini
. (Disabled by default, because it noticably increases loading times.)
get_critter_current_ap
int get_critter_current_ap(CritterPtr)
Should only be used during the target critters turn while in combat. Calling it outside of combat typically returns the critters max ap, but don’t rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.)
get_last_attacker
ObjectPtr get_last_attacker(ObjectPtr critter)
Will return the last critter to deliberately launch an attack against the argument critter. If a critter has not launched/received an attack, it will return 0. Outside of combat always returns 0.
get_last_target
ObjectPtr get_last_target(ObjectPtr critter)
Will return the last critter to be deliberately attacked. Outside of combat always returns 0.
reset_critical_table
void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)
Resets the critical table to default (or to the contents of CriticalOverrides.ini
, if it exists). For details see ‘http://falloutmods.wikia.com/wiki/Critical_hit_tables’. Requires OverrideCriticalTable
to be set to 1 in ddraw.ini
. (Disabled by default, because it noticably increases loading times.)
set_bodypart_hit_modifier
void set_bodypart_hit_modifier(int bodypart, int value)
Alters the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload.
set_critical_table
void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)
Used for modifying the critical table. For details see critical hit tables. Changes are not saved, and will reset to the defaults, (or to the contents of CriticalOverrides.ini
, if it exists) at each game reload. Requires OverrideCriticalTable
to be set to 1 in ddraw.ini
. (Disabled by default, because it noticably increases loading times.)
set_critter_burst_disable
void set_critter_burst_disable(int critter, int disable)
set_critter_current_ap
void set_critter_current_ap(CritterPtr, int ap)
Should only be used during the target critters turn while in combat.