1 .float porto_grenade_id;
3 void W_Porto_Explode (void)
8 void W_Porto_Touch1 (void)
10 if(self.porto_grenade_id == 0)
12 self.porto_grenade_id = time;
13 if(!Portal_SpawnInPortalAtTrace(self.owner, self.velocity, self.porto_grenade_id))
15 self.porto_grenade_id = 0;
21 Portal_SpawnOutPortalAtTrace(self.owner, self.velocity, self.porto_grenade_id);
22 self.porto_grenade_id = 0;
27 void W_Porto_Attack (void)
31 if (cvar("g_use_ammunition"))
32 self.weapons = self.weapons - (self.weapons & WEPBIT_PORTO);
33 W_SetupShot (self, '0 0 0', FALSE, 4, "weapons/grenade_fire.wav");
35 //pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
39 gren.classname = "porto";
40 gren.bot_dodge = TRUE;
41 gren.bot_dodgerating = 200;
42 gren.movetype = MOVETYPE_BOUNCEMISSILE;
43 gren.solid = SOLID_BBOX;
44 gren.effects = EF_LOWPRECISION;
45 gren.modelflags = MF_GRENADE;
46 setmodel(gren, "models/grenademodel.md3"); // precision set above
47 setsize(gren, '0 0 0', '0 0 0');
48 setorigin(gren, w_shotorg);
50 gren.nextthink = time + cvar("g_balance_porto_primary_lifetime");
51 gren.think = W_Porto_Explode;
52 gren.touch = W_Porto_Touch1;
53 gren.velocity = w_shotdir * cvar("g_balance_porto_primary_speed");
54 W_SetupProjectileVelocity(gren);
56 gren.angles = vectoangles (gren.velocity);
57 gren.flags = FL_PROJECTILE;
60 void W_Porto_Attack2 (void)
62 // nothing yet (maybe find the last one and detonate it?)
65 void spawnfunc_weapon_porto (void)
67 weapon_defaultspawnfunc(WEP_PORTO, 5000);
70 float w_porto(float req)
74 self.BUTTON_ATCK = FALSE;
75 self.BUTTON_ATCK2 = FALSE;
76 if(bot_aim(cvar("g_balance_porto_primary_speed"), 0, cvar("g_balance_grenadelauncher_primary_lifetime"), FALSE))
77 self.BUTTON_ATCK = TRUE;
79 else if (req == WR_THINK)
82 if (weapon_prepareattack(0, cvar("g_balance_porto_primary_refire")))
85 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_porto_primary_animtime"), w_ready);
88 else if (req == WR_PRECACHE)
90 precache_model ("models/grenademodel.md3");
91 precache_model ("models/weapons/g_porto.md3");
92 precache_model ("models/weapons/v_porto.md3");
93 precache_model ("models/weapons/w_porto.zym");
94 precache_sound ("weapons/grenade_fire.wav");
96 else if (req == WR_SETUP)
97 weapon_setup(WEP_PORTO);
98 else if (req == WR_SUICIDEMESSAGE)
99 w_deathtypestring = "did the impossible";
100 else if (req == WR_KILLMESSAGE)
101 w_deathtypestring = "felt # doing the impossible";
102 else if (req == WR_SPAWNFUNC)
103 spawnfunc_weapon_porto();