25 if (wepent.activeweapon != WEP_PORTO)
continue;
30 pos +=
v_right * -wepent.movedir.y
31 +
v_up * wepent.movedir.z;
33 if (wepent.angles_held_status)
39 wepent.polyline[0] = pos;
41 int portal_number = 0, portal1_idx = 1, portal_max = 2;
45 traceline(pos, pos + 65536 *
dir,
true,
this);
48 wepent.polyline[++idx] = pos;
71 if (portal_number >= portal_max)
break;
72 if (portal_number == 1) portal1_idx = idx;
74 for (
int idx = 0; idx < n - 1; ++idx)
76 vector p = wepent.polyline[idx], q = wepent.polyline[idx + 1];
77 if (idx == 0) p -=
view_up * 16;
78 vector rgb = (idx < portal1_idx) ?
'1 0 0' :
'0 0 1';
100 objerror(
this,
"Cannot succeed successfully: no owner\n");
112 objerror(
this,
"Cannot fail successfully: no owner\n");
129 if(nudgeoutofsolid_OrFallback(
this))
134 tracetoss(
this,
this);
148 if(p.porto_current.realowner == p && p.porto_current.classname ==
"porto")
157 if(this.
realowner.playerid !=
this.playerid)
170 if(
toucher.classname ==
"portal")
186 if(this.
realowner.playerid !=
this.playerid)
205 else if(this.
cnt == 0)
222 else if(this.
cnt == 1)
261 if(this.
realowner.portal_in.portal_id ==
this.portal_id)
298 gren.weaponentity_fld = weaponentity;
300 gren.owner = gren.realowner = actor;
301 gren.playerid = actor.playerid;
302 gren.bot_dodge =
true;
303 gren.bot_dodgerating = 200;
309 setsize(gren,
'0 0 0',
'0 0 0');
326 gren.portal_id =
time;
327 actor.porto_current = gren;
328 gren.playerid = actor.playerid;
356 if(!actor.porto_current)
357 if(!actor.porto_forbidden)
365 if(!actor.porto_current)
366 if(!actor.porto_forbidden)
375 if(actor.(weaponentity).porto_v_angle_held)
388 if(actor.(weaponentity).porto_v_angle_held)
392 if(!actor.porto_current)
393 if(!actor.porto_forbidden)
416 actor.porto_current =
NULL;
424 LOG_WARN(
"Since when does Porto send DamageInfo?");
434 PAR(_(
"The %s is a unique gun that creates one-way portals between flat surfaces on the map, that immediately teleport players and projectiles."),
COLORED_NAME(
this));
435 PAR(_(
"The secondary fire is used to shoot the out-portal, while the primary fire shoots the in-portal."));
436 PAR(_(
"It doesn't require ammo, but it is destroyed after some time."));
437 PAR(_(
"The portals will close either after the player who shot them dies or after some time period."));
438 PAR(_(
"The %s isn't often placed on maps, but if used well it can make for some interesting gameplay."),
COLORED_NAME(
this));
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
IntrusiveList g_bot_dodge
#define MUTATOR_CALLHOOK(id,...)
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
IntrusiveList g_drawables
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
#define COLORED_NAME(this)
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float CheckWireframeBox(entity forent, vector v0, vector dvx, vector dvy, vector dvz)
void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
const vector PL_MIN_CONST
const float DRAWFLAG_NORMAL
float trace_dphitcontents
float Q3SURFACEFLAG_SLICK
float DPCONTENTS_PLAYERCLIP
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
vector trace_plane_normal
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
vector warpzone_save_view_angles
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define METHOD(cname, name, prototype)
float Portal_SpawnOutPortalAtTrace(entity own, vector dir, float portal_id_val)
void Portal_ClearWithID(entity own, float id)
void Portal_ClearAll_PortalsOnly(entity own)
float Portal_SpawnInPortalAtTrace(entity own, vector dir, float portal_id_val)
vector polyline[polyline_length]
void W_Porto_Success(entity this)
void W_Porto_Fail(entity this, float failhard)
void Porto_Draw(entity this)
const int polyline_length
void W_Porto_Think(entity this)
void W_Porto_Remove(entity p)
void W_Porto_Touch(entity this, entity toucher)
void W_Porto_Attack(Weapon thiswep, entity actor,.entity weaponentity, float type)
const int PROJECTILE_PORTO_BLUE
const int PROJECTILE_PORTO_RED
IntrusiveList g_projectiles
#define PROJECTILE_MAKETRIGGER(e)
#define sound(e, c, s, v, a)
float spamsound(entity e, int chan, Sound samp, float vol, float _atten)
use this one if you might be causing spam (e.g.
#define STATIC_INIT(func)
during worldspawn
bool StatusEffects_active(StatusEffect this, entity actor)
float autocvar_g_balance_powerup_strength_force
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
float W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo,.entity weaponentity)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define W_SetupProjVelocity_Basic(ent, pspeed, pspread)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
ERASEABLE vector reflect(vector dir, vector norm)
int autocvar_chase_active
entity viewmodels[MAX_WEAPONSLOTS]
string W_Guide_Keybinds(Weapon wep)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR_BOTH(wep, isprimary, name)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_SEC(wep, name)
const int MAX_WEAPONSLOTS
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)