(SubgameEntity self, float[] start, float[] dir,
int damage, int speed, float damage_radius, int radius_damage, GameExportsImpl gameExports)
| 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 | * ================= |
no test coverage detected