/* wepimg */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
/* refname */ ATTRIB(MineLayer, netname, string, "minelayer");
/* wepname */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, NONE) \
+ P(class, prefix, animtime, float, NONE) \
+ P(class, prefix, damageforcescale, float, NONE) \
+ P(class, prefix, damage, float, NONE) \
+ P(class, prefix, detonatedelay, float, NONE) \
+ P(class, prefix, edgedamage, float, NONE) \
+ P(class, prefix, force, float, NONE) \
+ P(class, prefix, health, float, NONE) \
+ P(class, prefix, lifetime, float, NONE) \
+ P(class, prefix, lifetime_countdown, float, NONE) \
+ P(class, prefix, limit, float, NONE) \
+ P(class, prefix, protection, float, NONE) \
+ P(class, prefix, proximityradius, float, NONE) \
+ P(class, prefix, radius, float, NONE) \
+ P(class, prefix, refire, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, remote_damage, float, NONE) \
+ P(class, prefix, remote_edgedamage, float, NONE) \
+ P(class, prefix, remote_force, float, NONE) \
+ P(class, prefix, remote_radius, float, NONE) \
+ P(class, prefix, speed, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, time, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, MineLayer, minelayer)
+#undef X
ENDCLASS(MineLayer)
-REGISTER_WEAPON(MINE_LAYER, NEW(MineLayer));
-
-#define MINELAYER_SETTINGS(w_cvar,w_prop) MINELAYER_SETTINGS_LIST(w_cvar, w_prop, MINE_LAYER, minelayer)
-#define MINELAYER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
- w_cvar(id, sn, NONE, ammo) \
- w_cvar(id, sn, NONE, animtime) \
- w_cvar(id, sn, NONE, damage) \
- w_cvar(id, sn, NONE, damageforcescale) \
- w_cvar(id, sn, NONE, detonatedelay) \
- w_cvar(id, sn, NONE, edgedamage) \
- w_cvar(id, sn, NONE, force) \
- w_cvar(id, sn, NONE, health) \
- w_cvar(id, sn, NONE, lifetime) \
- w_cvar(id, sn, NONE, lifetime_countdown) \
- w_cvar(id, sn, NONE, limit) \
- w_cvar(id, sn, NONE, protection) \
- w_cvar(id, sn, NONE, proximityradius) \
- w_cvar(id, sn, NONE, radius) \
- w_cvar(id, sn, NONE, refire) \
- w_cvar(id, sn, NONE, remote_damage) \
- w_cvar(id, sn, NONE, remote_edgedamage) \
- w_cvar(id, sn, NONE, remote_force) \
- w_cvar(id, sn, NONE, remote_radius) \
- w_cvar(id, sn, NONE, speed) \
- w_cvar(id, sn, NONE, time) \
- w_prop(id, sn, float, reloading_ammo, reload_ammo) \
- w_prop(id, sn, float, reloading_time, reload_time) \
- w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \
- w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
- w_prop(id, sn, string, weaponreplace, weaponreplace) \
- w_prop(id, sn, float, weaponstart, weaponstart) \
- w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) \
- w_prop(id, sn, float, weaponthrowable, weaponthrowable)
+REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
#ifdef SVQC
-MINELAYER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
void W_MineLayer_Think();
.float minelayer_detonate, mine_explodeanyway;
.float mine_time;
sound(actor, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM);
}
}
- METHOD(MineLayer, wr_init, void(entity thiswep))
- {
- MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- }
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep))
{
int slot = 0; // TODO: unhardcode
else
return false;
}
- METHOD(MineLayer, wr_config, void(entity thiswep))
- {
- MINELAYER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- }
METHOD(MineLayer, wr_resetplayers, void(entity thiswep))
{
self.minelayer_mines = 0;