예제 #1
0
        /** The Moster fires the railgun. */
        public static void monster_fire_railgun(edict_t self, float[] start, float[] aimdir, int damage, int kick, int flashtype)
        {
            GameWeapon.fire_rail(self, start, aimdir, damage, kick);

            GameBase.gi.WriteByte(Defines.svc_muzzleflash2);
            GameBase.gi.WriteShort(self.index);
            GameBase.gi.WriteByte(flashtype);
            GameBase.gi.multicast(start, Defines.MULTICAST_PVS);
        }
예제 #2
0
        // FIXME monsters should call these with a totally accurate direction
        //	and we can mess it up based on skill. Spread should be for normal
        //	and we can tighten or loosen based on skill. We could muck with
        //	the damages too, but I'm not sure that's such a good idea.
        public static void monster_fire_bullet(edict_t self, float[] start, float[] dir, int damage, int kick, int hspread, int vspread, int flashtype)
        {
            GameWeapon.fire_bullet(self, start, dir, damage, kick, hspread, vspread, Defines.MOD_UNKNOWN);

            GameBase.gi.WriteByte(Defines.svc_muzzleflash2);
            GameBase.gi.WriteShort(self.index);
            GameBase.gi.WriteByte(flashtype);
            GameBase.gi.multicast(start, Defines.MULTICAST_PVS);
        }
예제 #3
0
        /** The Moster fires the rocket. */
        public static void monster_fire_rocket(edict_t self, float[] start, float[] dir, int damage, int speed, int flashtype)
        {
            GameWeapon.fire_rocket(self, start, dir, damage, speed, damage + 20, damage);

            GameBase.gi.WriteByte(Defines.svc_muzzleflash2);
            GameBase.gi.WriteShort(self.index);
            GameBase.gi.WriteByte(flashtype);
            GameBase.gi.multicast(start, Defines.MULTICAST_PVS);
        }
예제 #4
0
        /**
         * QUAKED turret_breach (0 0 0) ? This portion of the turret can change both
         * pitch and yaw. The model should be made with a flat pitch. It (and the
         * associated base) need to be oriented towards 0. Use "angle" to set the
         * starting angle.
         *
         * "speed" default 50 "dmg" default 10 "angle" point this forward "target"
         * point this at an info_notnull at the muzzle tip "minpitch" min acceptable
         * pitch angle : default -30 "maxpitch" max acceptable pitch angle : default
         * 30 "minyaw" min acceptable yaw angle : default 0 "maxyaw" max acceptable
         * yaw angle : default 360
         */
        public static void turret_breach_fire(edict_t self)
        {
            float[] f     = { 0, 0, 0 }, r = { 0, 0, 0 }, u = { 0, 0, 0 };
            float[] start = { 0, 0, 0 };
            int     damage;
            int     speed;

            Math3D.AngleVectors(self.s.angles, f, r, u);
            Math3D.VectorMA(self.s.origin, self.move_origin[0], f, start);
            Math3D.VectorMA(start, self.move_origin[1], r, start);
            Math3D.VectorMA(start, self.move_origin[2], u, start);

            damage = (int)(100 + Lib.random() * 50);
            speed  = (int)(550 + 50 * GameBase.skill.value);
            GameWeapon.fire_rocket(self.teammaster.owner, start, f, damage, speed, 150, damage);
            GameBase.gi.positioned_sound(start, self, Defines.CHAN_WEAPON, GameBase.gi.soundindex("weapons/rocklf1a.wav"), 1, Defines.ATTN_NORM, 0);
        }