Mircea Kitsune [Sun, 10 Apr 2011 21:21:41 +0000 (00:21 +0300)]
Stop showing the effect on gibbed dead bodies, and only show it on gibs instead. This fixes damage effects showing where the body is after it has been gibbed, therefore displaying there for no reason (also means less particles and better performance with gibs).
Mircea Kitsune [Sun, 10 Apr 2011 21:07:32 +0000 (00:07 +0300)]
Send the dead body / gibbed status as a separate WriteByte. I really see no other way of doing it. It's just one extra byte after all, and the entity is sent less intensively now that we added some checks to prevent extra networking.
Mircea Kitsune [Sun, 10 Apr 2011 17:19:45 +0000 (20:19 +0300)]
Use a trick to indicate dead bodies to the client. Read code comments for more info on how it works. This requires that Xonotic will never have more than 99 species (although afaik, they currently range from 0 to 15, so it will likely never happen).
Mircea Kitsune [Sun, 10 Apr 2011 15:22:56 +0000 (18:22 +0300)]
Use the same probability system on players as on gibs. The cvar can be set to anything between 0 and 1 to specify probability of the effect showing each tick, allowing its intensity to be tweaked client side for performance and personal taste.
Mircea Kitsune [Sun, 10 Apr 2011 14:32:28 +0000 (17:32 +0300)]
Use checkpvs to determine if the client we're sending to can see the player with the damage effects. If not, abort sending to it. Should save a lot of bandwidth compared to before.
ACTUALLY make drawpic_aspect_skin_expanding use the proper rendering for the aspect ratio. Fixes a bug that the expanding image mismatches the normal image in the HUD, now can be used for any HUD skin
By request of many, swap the priority for grenadelauncher and minelayer - Most people want the grenadelauncher to come up first when they press the bind.
Mircea Kitsune [Mon, 4 Apr 2011 14:10:27 +0000 (17:10 +0300)]
Always apply the effect to bodies as well, even if gibs from that player are found. Otherwise, if a body is gibbed but the player has respawned, both the gibs and respawned player having damage effects would cause the gibs blocking the effect on the respawned player. Not sure how this can be prevented, but it shouldn't be a big issue.
This enables a featured I added in the engine a while ago which basically smooths the view when crouching (previously it was an instant switch... which looked very odd.) This was SUPPOSED to be added into master a long time ago, but I didn't notice as I had it in my config.
Mircea Kitsune [Sun, 3 Apr 2011 22:24:57 +0000 (01:24 +0300)]
Copy an existing damage repeater to another entity by properly re-creating a new one, rather than using CopyEntity(). That was very buggy, and this seems to be safer, even if sometimes the effect won't show on players that respawn for some reason.
Mircea Kitsune [Sun, 3 Apr 2011 21:33:12 +0000 (00:33 +0300)]
Undo one of my changes with ent num. I think it's best for our code if the body entnum is sent as it is, as our own damaged body can be shown to us after respawn.
Mircea Kitsune [Sun, 3 Apr 2011 21:30:40 +0000 (00:30 +0300)]
Make dead bodies not take any more damage after they gib. This should have always happened IMO, as it makes no sense to make a fully hidden entity jump around when shot.
Mircea Kitsune [Sun, 3 Apr 2011 21:02:30 +0000 (00:02 +0300)]
Fix many issues with how the effect is handles. Including copying it to dead bodies in CopyBody, removing it from players that disconnect or become spectators, and removing previous effects from players that respawn.
Mircea Kitsune [Sun, 3 Apr 2011 16:53:32 +0000 (19:53 +0300)]
Second part of my latest change. When a body is gibbed, the damage effect will apply to the gibs instead of him. This will need much more work, as showing the same effect on each gib causes too many particles.
Mircea Kitsune [Sun, 3 Apr 2011 16:32:25 +0000 (19:32 +0300)]
First part of my attempt to apply damage effects to gibs as well. Send the entity number of the player when gibbing occurs, and set each gib's team function to it. The damage code in the client shall later scan for gibs, and if their owner's entity number is the same as the damaged player, draw particles there instead.
Mircea Kitsune [Sun, 3 Apr 2011 12:12:12 +0000 (15:12 +0300)]
Network over one more byte, specifying if the damaged player is our own self. We need to know this in the client so we can disable self damage effects only if we aren't in chase_active mode, or other circumstances. I couldn't find any way to determine this in the client, so I have to network one more byte for this.
Mircea Kitsune [Sat, 2 Apr 2011 21:55:45 +0000 (00:55 +0300)]
If the repeater is being updated, increase its lifetime instead of re-setting it entirely. This fixes the shotgun among other things, where only the damage of one bullet would be taken into account. Also fix an issue I can't understand with some field entities...
Mircea Kitsune [Sat, 2 Apr 2011 21:10:23 +0000 (00:10 +0300)]
Do as said in the last commit, and update the effect instead of waiting for old ones to finish. eg: If you are shot with the Laser while still bleeding after having been shot by the Shotgun, the damage effect will update to the red laser smoke and replace the blood, rather than being ignored cuz we were still bleeding from the Shotgun.
Mircea Kitsune [Sat, 2 Apr 2011 20:57:50 +0000 (23:57 +0300)]
Turn the repeater entity into a field entity. This will allow us to modify its properties, allowing some new features (such as modifying the existing damage effect rather than having to wait for it to finish so we can spawn a new one).
Mircea Kitsune [Sat, 2 Apr 2011 20:50:15 +0000 (23:50 +0300)]
Base the lifetime of a damage effect on the damage done. Amount stays the same, but the more damage the longer the effect will last. Does not add and extra networking, as this is done server-side.
Mircea Kitsune [Sat, 2 Apr 2011 17:09:45 +0000 (20:09 +0300)]
If the weapon is a bullet weapon (shotgun uzi or sniper), its damage effect is blood. Since blood is species dependent, we make their effects per-species.