X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fporto.qc;h=d54b6a71428ebb9a90ced86e89039f2a18e2ef16;hb=49a39c8c8c3b048a27cfa896c5a8221e8f49afb9;hp=44b73fb05ab3a3db2d121ee585abe14700902c3b;hpb=93afc08b09294e6dea4d0c98ce5226fdee9d1c92;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 44b73fb05..d54b6a714 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -13,7 +13,7 @@ const int polyline_length = 16; .vector polyline[polyline_length]; void Porto_Draw(entity this) { - if (spectatee_status || intermission == 1 || intermission == 2 || STAT(HEALTH) <= 0 || WEP_CVAR(porto, secondary)) return; + if (spectatee_status || intermission == 1 || intermission == 2 || STAT(HEALTH) <= 0 || WEP_CVAR(WEP_PORTO, secondary)) return; for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { @@ -118,9 +118,10 @@ void W_Porto_Fail(entity this, float failhard) if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(STAT(WEAPONS, this.realowner) & WEPSET(PORTO))) { - setsize(this, '-16 -16 0', '16 16 32'); + // FIXME: item properties should be obtained from the registry + setsize(this, ITEM_D_MINS, ITEM_D_MAXS); setorigin(this, this.origin + trace_plane_normal); - if(move_out_of_solid(this)) + if(nudgeoutofsolid(this)) { this.flags = FL_ITEM; IL_PUSH(g_items, this); @@ -171,7 +172,7 @@ void W_Porto_Touch(entity this, entity toucher) traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * PL_MIN_CONST.z, MOVE_WORLDONLY, this); if(trace_fraction >= 1) return; - if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP) + if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK) || (trace_dphitcontents & DPCONTENTS_PLAYERCLIP)) return; if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) return; @@ -302,14 +303,15 @@ void W_Porto_Attack(Weapon thiswep, entity actor, .entity weaponentity, float ty setorigin(gren, w_shotorg); setsize(gren, '0 0 0', '0 0 0'); - gren.nextthink = time + WEP_CVAR_BOTH(porto, (type <= 0), lifetime); + gren.nextthink = time + WEP_CVAR_BOTH(WEP_PORTO, (type <= 0), lifetime); setthink(gren, W_Porto_Think); settouch(gren, W_Porto_Touch); - if(actor.items & ITEM_Strength.m_itemid) - W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0); + // TODO: handle as mutator effect + if(StatusEffects_active(STATUSEFFECT_Strength, actor)) + W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(WEP_PORTO, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0); else - W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0); + W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(WEP_PORTO, (type <= 0), speed), 0); gren.angles = vectoangles(gren.velocity); gren.flags = FL_PROJECTILE; @@ -336,30 +338,30 @@ METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor, .entity weaponent { PHYS_INPUT_BUTTON_ATCK(actor) = false; PHYS_INPUT_BUTTON_ATCK2(actor) = false; - if(!WEP_CVAR(porto, secondary)) - if(bot_aim(actor, weaponentity, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false)) + if(!WEP_CVAR(WEP_PORTO, secondary)) + if(bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_PORTO, speed), 0, WEP_CVAR_PRI(WEP_PORTO, lifetime), false, true)) PHYS_INPUT_BUTTON_ATCK(actor) = true; } METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { - if(WEP_CVAR(porto, secondary)) + if(WEP_CVAR(WEP_PORTO, secondary)) { if(fire & 1) if(!actor.porto_current) if(!actor.porto_forbidden) - if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire))) + if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_PORTO, refire))) { W_Porto_Attack(thiswep, actor, weaponentity, 0); - weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready); + weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_PORTO, animtime), w_ready); } if(fire & 2) if(!actor.porto_current) if(!actor.porto_forbidden) - if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(porto, refire))) + if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_PORTO, refire))) { W_Porto_Attack(thiswep, actor, weaponentity, 1); - weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready); + weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_PORTO, animtime), w_ready); } } else @@ -383,10 +385,10 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone if(fire & 1) if(!actor.porto_current) if(!actor.porto_forbidden) - if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire))) + if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_PORTO, refire))) { W_Porto_Attack(thiswep, actor, weaponentity, -1); - weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready); + weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_PORTO, animtime), w_ready); } } }