(SubgameEntity self, SubgameEntity other, cplane_t plane,
csurface_t surf, GameExportsImpl gameExports)
| 39 | public String getID() { return "blaster_touch"; } |
| 40 | |
| 41 | public void touch(SubgameEntity self, SubgameEntity other, cplane_t plane, |
| 42 | csurface_t surf, GameExportsImpl gameExports) { |
| 43 | |
| 44 | if (other == self.getOwner()) |
| 45 | return; |
| 46 | |
| 47 | if (surf != null && (surf.flags & Defines.SURF_SKY) != 0) { |
| 48 | gameExports.freeEntity(self); |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | if (gameExports.gameImports.cvar("dev_blaster", "0", 0).value == 1) { |
| 53 | if (self.getOwner().getClient() != null && !"worldspawn".equalsIgnoreCase(other.classname)) { |
| 54 | gameExports.gameImports.centerprintf(gameExports.g_edicts[1], buildEntityInfo(other) + "\n"); |
| 55 | gameExports.freeEntity(self); |
| 56 | return; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if (self.getOwner().getClient() != null) { |
| 61 | PlayerWeapon.PlayerNoise(self.getOwner(), self.s.origin, GameDefines.PNOISE_IMPACT, gameExports); |
| 62 | } |
| 63 | |
| 64 | if (other.takedamage != 0) { |
| 65 | int mod; |
| 66 | if ((self.spawnflags & 1) != 0) |
| 67 | mod = GameDefines.MOD_HYPERBLASTER; |
| 68 | else |
| 69 | mod = GameDefines.MOD_BLASTER; |
| 70 | |
| 71 | // bugfix null plane rst |
| 72 | float[] normal; |
| 73 | if (plane == null) |
| 74 | normal = new float[3]; |
| 75 | else |
| 76 | normal = plane.normal; |
| 77 | |
| 78 | GameCombat.T_Damage(other, self, self.getOwner(), self.velocity, |
| 79 | self.s.origin, normal, self.dmg, 1, |
| 80 | DamageFlags.DAMAGE_ENERGY, mod, gameExports); |
| 81 | |
| 82 | } else { |
| 83 | final float[] dir; |
| 84 | if (plane == null) |
| 85 | dir = Globals.vec3_origin; |
| 86 | else |
| 87 | dir = plane.normal; |
| 88 | gameExports.gameImports.multicastMessage(self.s.origin, new PointDirectionTEMessage(Defines.TE_BLASTER, self.s.origin, dir), MulticastTypes.MULTICAST_PVS); |
| 89 | } |
| 90 | |
| 91 | gameExports.freeEntity(self); |
| 92 | } |
| 93 | }; |
| 94 | |
| 95 | public static String buildEntityInfo(SubgameEntity other) { |
no test coverage detected