MCPcopy Create free account
hub / github.com/demoth/jake2 / fire_rocket

Method fire_rocket

game/src/main/java/jake2/game/GameWeapon.java:844–874  ·  view source on GitHub ↗
(SubgameEntity self, float[] start, float[] dir,
                                   int damage, int speed, float damage_radius, int radius_damage, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

842 }
843
844 public static void fire_rocket(SubgameEntity self, float[] start, float[] dir,
845 int damage, int speed, float damage_radius, int radius_damage, GameExportsImpl gameExports) {
846
847 SubgameEntity rocket = gameExports.G_Spawn();
848 Math3D.VectorCopy(start, rocket.s.origin);
849 Math3D.VectorCopy(dir, rocket.movedir);
850 Math3D.vectoangles(dir, rocket.s.angles);
851 Math3D.VectorScale(dir, speed, rocket.velocity);
852 rocket.movetype = GameDefines.MOVETYPE_FLYMISSILE;
853 rocket.clipmask = Defines.MASK_SHOT;
854 rocket.solid = Defines.SOLID_BBOX;
855 rocket.s.effects |= Defines.EF_ROCKET;
856 Math3D.VectorClear(rocket.mins);
857 Math3D.VectorClear(rocket.maxs);
858 rocket.s.modelindex = gameExports.gameImports
859 .modelindex("models/objects/rocket/tris.md2");
860 rocket.setOwner(self);
861 rocket.touch = rocket_touch;
862 rocket.think.nextTime = gameExports.level.time + 8000 / speed;
863 rocket.think.action = GameUtil.G_FreeEdictA;
864 rocket.dmg = damage;
865 rocket.radius_dmg = radius_damage;
866 rocket.dmg_radius = damage_radius;
867 rocket.s.sound = gameExports.gameImports.soundindex("weapons/rockfly.wav");
868 rocket.classname = "rocket";
869
870 if (self.getClient() != null)
871 check_dodge(self, rocket.s.origin, dir, speed, gameExports);
872
873 gameExports.gameImports.linkentity(rocket);
874 }
875
876 /*
877 * =================

Callers 3

thinkMethod · 0.95
turret_breach_fireMethod · 0.95
monster_fire_rocketMethod · 0.95

Calls 11

VectorCopyMethod · 0.95
vectoanglesMethod · 0.95
VectorScaleMethod · 0.95
VectorClearMethod · 0.95
setOwnerMethod · 0.95
check_dodgeMethod · 0.95
G_SpawnMethod · 0.80
modelindexMethod · 0.65
soundindexMethod · 0.65
linkentityMethod · 0.65
getClientMethod · 0.45

Tested by

no test coverage detected