REGISTER_BUFF(_("Jump"),jump,JUMP,10,'0.7 0.2 1');
REGISTER_BUFF(_("Flight"),flight,FLIGHT,11,'1 0.2 0.5');
REGISTER_BUFF(_("Invisible"),invisible,INVISIBLE,12,'0.9 0.9 0.9');
+#undef REGISTER_BUFF
#ifdef SVQC
.float buffs;
void buff_Init_Compat(entity ent, float replacement);
#define BUFF_SPAWNFUNC(e,b,t) void spawnfunc_item_buff_##e() { self.buffs = b; self.team = t; buff_Init(self); }
-#define BUFF_SPAWNFUNC_Q3TA_COMPAT(o,r) void spawnfunc_##o() { buff_Init_Compat(self,r); }
+#define BUFF_SPAWNFUNC_Q3TA_COMPAT(o,r) void spawnfunc_item_##o() { buff_Init_Compat(self,r); }
#define BUFF_SPAWNFUNCS(e,b) \
BUFF_SPAWNFUNC(e, b, 0) \
BUFF_SPAWNFUNC(e##_team1, b, NUM_TEAM_1) \
BUFF_SPAWNFUNCS(invisible, BUFF_INVISIBLE)
BUFF_SPAWNFUNCS(random, 0)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(item_doubler, BUFF_MEDIC)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(item_resistance, BUFF_RESISTANCE)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(item_scout, BUFF_SPEED)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(item_ammoregen, BUFF_AMMO)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_MEDIC)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(scout, BUFF_SPEED)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(ammoregen, BUFF_AMMO)
+
+// actually Q3
+BUFF_SPAWNFUNC_Q3TA_COMPAT(flight, BUFF_FLIGHT)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(haste, BUFF_SPEED)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(invis, BUFF_INVISIBLE)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(medic, BUFF_MEDIC)
#endif
vector Buff_Color(float buff_id);
float buffs_BuffModel_Customize()
{
- float same_team = (SAME_TEAM(other, self.owner) || (IS_SPEC(other) && SAME_TEAM(other.enemy, self.owner)));
- if(self.owner.alpha <= 0.5 && !same_team && self.owner.alpha != 0)
+ entity player, myowner;
+ float same_team;
+
+ player = WaypointSprite_getviewentity(other);
+ myowner = self.owner;
+ same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner));
+
+ if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
return FALSE;
-
- if(other == self.owner || (IS_SPEC(other) && other.enemy == self.owner))
+
+ if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
{
// somewhat hide the model, but keep the glow
self.effects = 0;
if(!MoveToRandomMapLocation(ent, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((autocvar_g_buffs_random_location_attempts > 0) ? autocvar_g_buffs_random_location_attempts : 10), 1024, 256))
{
entity spot = SelectSpawnPoint(TRUE);
- setorigin(self, (spot.origin + '0 0 200') + (randomvec() * 300));
- self.angles = spot.angles;
+ setorigin(ent, ((spot.origin + '0 0 200') + (randomvec() * 300)));
+ ent.angles = spot.angles;
}
+ tracebox(ent.origin, ent.mins * 1.5, self.maxs * 1.5, ent.origin, MOVE_NOMONSTERS, ent);
+
+ setorigin(ent, trace_endpos); // attempt to unstick
+
ent.movetype = MOVETYPE_TOSS;
makevectors(ent.angles);
InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
}
-//void spawnfunc_item_flight() /* not supported */
-//void spawnfunc_item_haste() /* not supported */
+//void spawnfunc_item_flight() /* handled by buffs mutator */
+//void spawnfunc_item_haste() /* handled by buffs mutator */
//void spawnfunc_item_health() /* handled in t_quake.qc */
//void spawnfunc_item_health_large() /* handled in t_items.qc */
//void spawnfunc_item_health_small() /* handled in t_items.qc */
//void spawnfunc_item_health_mega() /* handled in t_items.qc */
-//void spawnfunc_item_invis() /* not supported */
-//void spawnfunc_item_regen() /* not supported */
+//void spawnfunc_item_invis() /* handled by buffs mutator */
+//void spawnfunc_item_regen() /* handled by buffs mutator */
// CTF spawnfuncs handled in mutators/gamemode_ctf.qc now
-void spawnfunc_item_flight() { spawnfunc_item_jetpack(); }
+//void spawnfunc_item_flight() { spawnfunc_item_jetpack(); }
.float notteam;
.float notsingle;