tfc-reference-data/plugins/test_gren.sma
Ryan Liptak 2a8a9a52ef Some more info/test plugins
Findings:
- RPG radius is random in line with the damage, and does ~0.5 damage at edge of radius. Radius is roughly similar to that in FF
- Frag gren damage falls off to 0 at the edge of its radius, and does more max damage than in FF.
- MIRV and MIRVlets do identical damage to frag grens
2020-11-14 15:38:53 -08:00

41 lines
No EOL
1.1 KiB
Text

#include <amxmodx>
#include <engine>
#define PLUGIN "Test Grenades"
#define VERSION "0.1"
#define AUTHOR "squeek."
#define TEST_GREN_TARGET_CVAR "test_gren_target"
#define TEST_GREN_RADIUS_CVAR "test_gren_radius"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_think("tf_weapon_normalgrenade", "gren_think")
register_cvar(TEST_GREN_TARGET_CVAR, "1")
register_cvar(TEST_GREN_RADIUS_CVAR, "0")
}
// teleport grenades to the origin of the target
public gren_think(gren_id)
{
if (get_cvar_num(TEST_GREN_TARGET_CVAR) < 0)
return
teleport_ent_to_ent(gren_id, get_cvar_num(TEST_GREN_TARGET_CVAR))
static Float:zero_velocity[3] = {0.0}
entity_set_vector(gren_id, EV_VEC_velocity, zero_velocity)
}
// move entity to the origin of the target
public teleport_ent_to_ent(ent_id, target_id)
{
if (!is_valid_ent(target_id) || !is_valid_ent(ent_id))
return
static Float:target_origin[3]
entity_get_vector(target_id, EV_VEC_origin, target_origin)
target_origin[0] = target_origin[0] + get_cvar_num(TEST_GREN_RADIUS_CVAR)
entity_set_vector(ent_id, EV_VEC_origin, target_origin)
}