set g_balance_grabber_primary_grabbered_time_free 1 // 1s being grabbered are free\r
set g_balance_grabber_primary_grabbered_fuel 5 // fuel per second grabbered\r
set g_balance_grabber_primary_recoil 2.5\r
+set g_balance_grabber_secondary 1\r
set g_balance_grabber_secondary_ammo 15\r
set g_balance_grabber_secondary_refire 1.1\r
set g_balance_grabber_secondary_animtime 1 // good melee anim\r
_cl_name "Player"\r
_cl_playermodel models/player/vixen.zym\r
_cl_playerskin 0\r
-crosshair 13\r
+seta crosshair 11\r
+seta crosshair_primary 13\r
+seta crosshair_secondary 14\r
seta crosshair_color "1 1 0.5"\r
seta crosshair_alpha 1\r
seta crosshair_size 0.35\r
seta crosshair_pickup 0.5 "crosshair grows then shrinks back when picking up an item"\r
seta crosshair_color_by_health 1 "if enabled, crosshair color will depend on current health"\r
-seta crosshair_unarmed_dim_color 0.5 "dim crosshair color by this amount when we aren't holding a weapon"\r
-seta crosshair_unarmed_dim_alpha 0.5 "dim crosshair alpha by this amount when we aren't holding a weapon"\r
+seta crosshair_unarmed_dim_color 0.75 "dim crosshair color to this amount when we aren't holding a weapon"\r
+seta crosshair_unarmed_dim_alpha 0.75 "dim crosshair alpha to this amount when we aren't holding a weapon"\r
seta crosshair_pickup_speed 4 "speed of the crosshair pickup effect"\r
seta crosshair_ring_alpha 0.5 "alpha of the crosshair ammo ring"\r
seta crosshair_ring_size 2.5 "size of the crosshair ammo ring"\r
velocitymultiplier -0.1\r
\r
\r
-// grabber melee\r
-// based off morphed's cl_gentle\r
-// used in qcsrc/server/w_grabber.qc\r
-effect grabber_melee\r
-tex 43 43\r
-count 3\r
-type spark\r
-color 0xffffff 0x0033ff\r
-size 8 16\r
-sizeincrease 34\r
-alpha 128 128 292\r
-gravity 0\r
-airfriction 5\r
-liquidfriction 10\r
-velocityjitter 25 25 25\r
-lightradius 200\r
-lightradiusfade 200\r
-lightcolor 0.4 0.7 0.9\r
-\r
-\r
//torch flame, spawn it as fast as you can 20 times per second or more, supports direction but not required\r
//fast fire\r
// used nowhere in code, meant for maps\r
else if(swallow_indicator < 0)\r
wcross_style = "_canswallow_no.tga";\r
else\r
- wcross_style = cvar_string("crosshair");\r
+ {\r
+ // normal crosshair, based on what weapon we have and what firing type we can use\r
+ if(!activeweapon)\r
+ wcross_style = cvar_string("crosshair");\r
+ else if(getstati(STAT_CROSSHAIR_STYLE))\r
+ wcross_style = cvar_string("crosshair_secondary");\r
+ else\r
+ wcross_style = cvar_string("crosshair_primary");\r
+ }\r
\r
if (wcross_style != "0") {\r
vector wcross_color, wcross_size;\r
const float STAT_VORE_EATEN = 55;\r
const float STAT_VORE_CANLEAVE = 56;\r
const float STAT_VORE_CANSWALLOW = 57;\r
-const float STAT_SBRING1_TYPE = 58;\r
-const float STAT_SBRING1_CLIP = 59;\r
-const float STAT_SBRING2_TYPE = 60;\r
-const float STAT_SBRING2_CLIP = 61;\r
-const float STAT_HUD = 62;\r
+const float STAT_CROSSHAIR_STYLE = 58;\r
+const float STAT_SBRING1_TYPE = 59;\r
+const float STAT_SBRING1_CLIP = 60;\r
+const float STAT_SBRING2_TYPE = 61;\r
+const float STAT_SBRING2_CLIP = 62;\r
+const float STAT_HUD = 63;\r
const float HUD_NORMAL = 0;\r
const float CTF_STATE_ATTACK = 1;\r
const float CTF_STATE_DEFEND = 2;\r
#ifdef INTERFACE\r
CLASS(VoretCrosshairButton) EXTENDS(RadioButton)\r
- METHOD(VoretCrosshairButton, configureVoretCrosshairButton, void(entity, float, float))\r
+ METHOD(VoretCrosshairButton, configureVoretCrosshairButton, void(entity, float, float, string))\r
METHOD(VoretCrosshairButton, setChecked, void(entity, float))\r
METHOD(VoretCrosshairButton, draw, void(entity))\r
ATTRIB(VoretCrosshairButton, fontSize, float, SKINFONTSIZE_NORMAL)\r
METHOD(VoretCrosshairButton, loadCvars, void(entity))\r
METHOD(VoretCrosshairButton, saveCvars, void(entity))\r
ENDCLASS(VoretCrosshairButton)\r
-entity makeVoretCrosshairButton(float, float);\r
+entity makeVoretCrosshairButton(float, float, string);\r
#endif\r
\r
#ifdef IMPLEMENTATION\r
-entity makeVoretCrosshairButton(float theGroup, float theCrosshair)\r
+entity makeVoretCrosshairButton(float theGroup, float theCrosshair, string theCvar)\r
{\r
entity me;\r
me = spawnVoretCrosshairButton();\r
- me.configureVoretCrosshairButton(me, theGroup, theCrosshair);\r
+ me.configureVoretCrosshairButton(me, theGroup, theCrosshair, theCvar);\r
return me;\r
}\r
-void configureVoretCrosshairButtonVoretCrosshairButton(entity me, float theGroup, float theCrosshair)\r
+void configureVoretCrosshairButtonVoretCrosshairButton(entity me, float theGroup, float theCrosshair, string theCvar)\r
{\r
- me.cvarName = "crosshair";\r
+ me.cvarName = theCvar;\r
me.cvarValueFloat = theCrosshair;\r
me.loadCvars(me);\r
me.configureRadioButton(me, string_null, me.fontSize, me.image, theGroup, 0);\r
METHOD(VoretWeaponsDialog, showNotify, void(entity))\r
ATTRIB(VoretWeaponsDialog, title, string, "Weapon & Crosshair settings")\r
ATTRIB(VoretWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)\r
- ATTRIB(VoretWeaponsDialog, intendedWidth, float, 0.7)\r
+ ATTRIB(VoretWeaponsDialog, intendedWidth, float, 1)\r
ATTRIB(VoretWeaponsDialog, rows, float, 20)\r
- ATTRIB(VoretWeaponsDialog, columns, float, 4)\r
+ ATTRIB(VoretWeaponsDialog, columns, float, 8)\r
ATTRIB(VoretWeaponsDialog, weaponsList, entity, NULL)\r
ENDCLASS(VoretWeaponsDialog)\r
#endif\r
me.TD(me, 1, 3, makeVoretTextLabel(0, "Weapon crosshair settings:"));\r
me.TR(me);\r
me.TDempty(me, 0.3);\r
- me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Crosshair:"));\r
+ me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Unarmed style:"));\r
for(i = 1; i <= 10; ++i) {\r
- me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(3, i), '1 1 0');\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(1, i, "crosshair"), '1 1 0');\r
}\r
me.TR(me);\r
me.TDempty(me, 0.3);\r
me.TDempty(me, 1);\r
for(i = 11; i <= 20; ++i) {\r
- me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(3, i), '1 1 0');\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(1, i, "crosshair"), '1 1 0');\r
}\r
+ me.TR(me);\r
+ me.TDempty(me, 0.3);\r
+ me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Primary style:"));\r
+ for(i = 1; i <= 10; ++i) {\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(2, i, "crosshair_primary"), '1 1 0');\r
+ }\r
+ me.TR(me);\r
+ me.TDempty(me, 0.3);\r
+ me.TDempty(me, 1);\r
+ for(i = 11; i <= 20; ++i) {\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(2, i, "crosshair_primary"), '1 1 0');\r
+ }\r
+ me.TR(me);\r
+ me.TDempty(me, 0.3);\r
+ me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Secondary style:"));\r
+ for(i = 1; i <= 10; ++i) {\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(3, i, "crosshair_secondary"), '1 1 0');\r
+ }\r
+ me.TR(me);\r
+ me.TDempty(me, 0.3);\r
+ me.TDempty(me, 1);\r
+ for(i = 11; i <= 20; ++i) {\r
+ me.TDNoMargin(me, 1, 2.5 / 10, e = makeVoretCrosshairButton(3, i, "crosshair_secondary"), '1 1 0');\r
+ }\r
+ me.TR(me);\r
me.TR(me);\r
me.TDempty(me, 0.3);\r
me.TD(me, 1, 1.25, e = makeVoretTextLabel(0, "Crosshair Size:"));\r
me.TR(me);\r
me.TDempty(me, 0.6);\r
me.TD(me, 1, 2, e = makeVoretCheckBox(0, "crosshair_color_by_health", "Colorize by health"));\r
- me.TR(me);\r
+\r
+ me.gotoRC(me, 0, 4); me.setFirstColumn(me, me.currentColumn);\r
+ me.TD(me, 1, 3, makeVoretTextLabel(0, "Crosshair effects:"));\r
me.TR(me);\r
me.TDempty(me, 0.3);\r
me.TD(me, 1, 1.25, e = makeVoretTextLabel(0, "Hit test:"));\r
.float status_teamhealing; // 0 = can't team heal, 1 = can team heal, 2 = team healing right now
-.float hold_BUTTON_ATCK; // marks the bot holding the fire button after having decided on his prey
+.float hold_BUTTON_ATCK2; // marks the bot holding the fire button after having decided on his prey
float Swallow_condition_check_bot(entity prey)
{
if(prey.health < cvar("g_balance_vore_teamheal_stable"))
if not(prey.digesting) // if our team mate is digesting someone, he likely wouldn't want us ruining his frag
if not(prey.flagcarried) // don't eat the flag carrier and ruin his job
- if not(prey.BUTTON_ATCK || prey.BUTTON_ATCK2) // our team mate wouldn't want us eating him while he's firing
+ if not(prey.BUTTON_ATCK || prey.BUTTON_ATCK2) // our team mate wouldn't want us eating him while he's attacking
{
if(time > self.decide_swallow)
{
// base the decision around HOW damaged the team mate is, centered around 100 health
if(skill * (100 / prey.health) >= random() * 10) // there are 10 bot skill steps
- self.hold_BUTTON_ATCK = TRUE; // swallow the team mate
+ self.hold_BUTTON_ATCK2 = TRUE; // swallow the team mate
self.decide_swallow = time + cvar("bot_ai_vore_decide_swallow") / self.bot_vorethinkpred; // this is needed to take a proper decision, otherwise the code would execute each frame and return TRUE quickly
}
}
else
- self.hold_BUTTON_ATCK = FALSE;
+ self.hold_BUTTON_ATCK2 = FALSE;
}
void Vore_AI()
if(skill / fear >= randomtry)
if not(teams_matter && prey.team == self.team)
{
- self.hold_BUTTON_ATCK = TRUE; // swallow
+ self.hold_BUTTON_ATCK2 = TRUE; // swallow
self.decide_pred = time + decide_pred_time; // time before the bot decides what to do with his prey
}
self.decide_swallow = time + cvar("bot_ai_vore_decide_swallow") / self.bot_vorethinkpred; // this is needed to take a proper decision, otherwise the code would execute each frame and return TRUE quickly
}
}
else
- self.hold_BUTTON_ATCK = FALSE;
+ self.hold_BUTTON_ATCK2 = FALSE;
// if the bot is holding the firing button, apply that to the actual fire key
- if(self.hold_BUTTON_ATCK)
- self.BUTTON_ATCK = TRUE;
+ if(self.hold_BUTTON_ATCK2)
+ self.BUTTON_ATCK2 = TRUE;
// deciding what to do with a victim:
.float stats_fired[WEP_MAXCOUNT]; // for hitscan bullets fired\r
\r
.float stat_sbring1_type, stat_sbring1_clip, stat_sbring2_type, stat_sbring2_clip;\r
+.float stat_crosshair_style;\r
\r
.float stat_leadlimit;\r
\r
addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting);\r
addstat(STAT_VORE_EATEN, AS_INT, stat_eaten);\r
addstat(STAT_VORE_CANLEAVE, AS_INT, stat_canleave);\r
+ addstat(STAT_CROSSHAIR_STYLE, AS_INT, stat_crosshair_style);\r
addstat(STAT_SBRING1_TYPE, AS_INT, stat_sbring1_type);\r
addstat(STAT_SBRING1_CLIP, AS_FLOAT, stat_sbring1_clip);\r
addstat(STAT_SBRING2_TYPE, AS_INT, stat_sbring2_type);\r
\r
if(swallow_complain != "")\r
{\r
- if(time > self.complain_vore && self.BUTTON_ATCK)\r
+ if(time > self.complain_vore && self.BUTTON_ATCK2)\r
{\r
play2(self, "misc/forbidden.wav");\r
sprint(self, swallow_complain);\r
else\r
self.stat_canswallow = 1;\r
\r
- if(self.BUTTON_ATCK)\r
+ if(self.BUTTON_ATCK2)\r
Vore_SwallowStep(prey);\r
}\r
else if(prey != world)\r
\r
WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self));\r
\r
- pointparticles(particleeffectnum("grabber_melee"), w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), '0 0 0', 1);\r
-\r
- if (trace_fraction < 1)\r
+ if(trace_fraction < 1) // should always be true, but just in case\r
{\r
Damage(trace_ent, self, self, cvar("g_balance_grabber_secondary_damage"), WEP_GRABBER | HITTYPE_SECONDARY, trace_endpos, cvar("g_balance_grabber_secondary_force") * w_shotdir);\r
pointparticles(particleeffectnum("grabber_impact2"), trace_endpos, '0 0 0', 1);\r
}\r
else if (req == WR_THINK)\r
{\r
+ // determine by distance if this will be primary fire or alternate fire\r
+ W_SetupShot (self, TRUE, 0, "", 0); // do this to update w_shotorg\r
+ WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self));\r
+ if(cvar("g_balance_grabber_secondary") && trace_fraction < 1 && !self.grabber) // not if hooked or firing the hook\r
+ self.stat_crosshair_style = 1;\r
+ else\r
+ self.stat_crosshair_style = 0;\r
+\r
grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel");\r
// forced reload\r
if(cvar("g_balance_grabber_reload_ammo") && self.clip_load < min(cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_secondary_ammo"))\r
if(self.ammo_fuel >= 1) // we only have one weapon in VT, so nothing else to switch to if we're out of ammo\r
weapon_action(self.weapon, WR_RELOAD);\r
}\r
- else if not(self.clip_load < 0) // we're not currently reloading\r
+ else if(self.clip_load >= 0 && !self.stat_eaten) // we're not currently reloading or eaten\r
{\r
- if (self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO1))\r
+ if(!self.stat_crosshair_style && self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO1)) // primary attack\r
{\r
- if(self.stat_eaten) // we can't use weapons while in the stomach\r
- return FALSE;\r
if(time < self.weapon_delay)\r
return FALSE;\r
\r
weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready); \r
}\r
}\r
- if (self.BUTTON_ATCK2 && weapon_action(self.weapon, WR_CHECKAMMO2))\r
+ else if (self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO2)) // secondary attack\r
{\r
- \r
- if(self.stat_eaten) // we can't use weapons while in the stomach\r
- return FALSE;\r
if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire")))\r
{\r
W_Grabber_Attack2();\r