Explosions
Functions
- get_explosion_damage
- item_make_explosive
- metarule2_explosions
- set_attack_explosion_art
- set_attack_explosion_pattern
- set_attack_explosion_radius
- set_attack_is_explosion_fire
- set_dynamite_damage
- set_explosion_max_targets
- set_explosion_radius
- set_plastic_damage
get_explosion_damage
sfall.h
array get_explosion_damage(itemPid)
Returns an array of the minimum and maximum damage of the explosive item.
item_make_explosive
sfall.h
void item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)
- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
maxDamage
is optionalactivePid
is for an item with an active timer, can be the same as thepid
argument- the item proto must be the Misc Item type and have the Use action flag
- minDamage/maxDamage are the minimum and maximum explosion damage
- using the function on an item that is already set as an explosive will override its previous settings
- NOTE: this function does not work for pids of Dynamite and Plastic Explosives
metarule2_explosions
int metarule2_explosions(int arg1, int arg2)
Was made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action.
set_attack_explosion_art
sfall.h
void set_attack_explosion_art(x, y)
Y not used and X is a misc frame ID (last 3 bytes, without object type) to use for the next explosion.
set_attack_explosion_pattern
sfall.h
void set_attack_explosion_pattern(x, y)
Currently Y is not used and X means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern.
set_attack_explosion_radius
sfall.h
void set_attack_explosion_radius(x)
Changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine).
set_attack_is_explosion_fire
sfall.h
void set_attack_is_explosion_fire
If you call this right before using a weapon with fire damage type (e.g. in HOOK_AFTERHITROLL
), it will produce explosion effects (and radius damage) just like “explosion” type, but all targets will still receive fire damage.
set_dynamite_damage
sfall.h
void set_dynamite_damage(minDmg, maxDmg)
Sets the minimum and maximum damage for Dynamite. Changed damage will be reset each time the player reloads the game.
set_explosion_max_targets
sfall.h
void set_explosion_max_targets(x)
Sets the maximum number of additional targets for an explosion, valid range: 1..6 (default is 6).
set_explosion_radius
sfall.h
void set_explosion_radius(grenade, rocket)
Sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius. Changed radius will be reset each time the player reloads the game.
set_plastic_damage
sfall.h
void set_plastic_damage(minDmg, maxDmg)
Sets the minimum and maximum damage for Plastic Explosives. Changed damage will be reset each time the player reloads the game.