#endif
/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
+/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
/* refname */ ATTRIB(Rifle, netname, string, "rifle");
/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
.float bot_secondary_riflemooth;
-METHOD(Rifle, wr_aim, void(entity thiswep, entity actor))
+METHOD(Rifle, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
PHYS_INPUT_BUTTON_ATCK(actor) = false;
PHYS_INPUT_BUTTON_ATCK2(actor) = false;
actor.bot_secondary_riflemooth = 0;
if(actor.bot_secondary_riflemooth == 0)
{
- if(bot_aim(actor, 1000000, 0, 0.001, false))
+ if(bot_aim(actor, weaponentity, 1000000, 0, 0.001, false))
{
PHYS_INPUT_BUTTON_ATCK(actor) = true;
if(random() < 0.01) actor.bot_secondary_riflemooth = 1;
}
else
{
- if(bot_aim(actor, 1000000, 0, 0.001, false))
+ if(bot_aim(actor, weaponentity, 1000000, 0, 0.001, false))
{
PHYS_INPUT_BUTTON_ATCK2(actor) = true;
if(random() < 0.03) actor.bot_secondary_riflemooth = 0;
}
METHOD(Rifle, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
- if(autocvar_g_balance_rifle_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload
+ if(autocvar_g_balance_rifle_reload_ammo && actor.(weaponentity).clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload
thiswep.wr_reload(thiswep, actor, weaponentity);
} else
{
}
}
}
-METHOD(Rifle, wr_checkammo1, bool(entity thiswep, entity actor))
+METHOD(Rifle, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
{
float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_PRI(rifle, ammo);
- ammo_amount += actor.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_PRI(rifle, ammo);
+ ammo_amount += actor.(weaponentity).(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_PRI(rifle, ammo);
return ammo_amount;
}
-METHOD(Rifle, wr_checkammo2, bool(entity thiswep, entity actor))
+METHOD(Rifle, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
{
float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(rifle, ammo);
- ammo_amount += actor.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo);
+ ammo_amount += actor.(weaponentity).(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo);
return ammo_amount;
}
METHOD(Rifle, wr_resetplayer, void(entity thiswep, entity actor))
return WEAPON_RIFLE_MURDER;
}
}
+METHOD(Rifle, wr_zoom, bool(entity thiswep, entity actor))
+{
+ return PHYS_INPUT_BUTTON_ATCK2(actor) && WEP_CVAR(rifle, secondary) == 0;
+}
#endif
#ifdef CSQC
precache_pic("gfx/reticle_nex");
}
}
-METHOD(Rifle, wr_zoomreticle, bool(entity thiswep))
+METHOD(Rifle, wr_zoom, bool(entity thiswep, entity actor))
{
if(button_zoom || zoomscript_caught)
{
- reticle_image = "gfx/reticle_nex";
return true;
}
else